This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee9ee1b
commit 93bab8f
Showing
2 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require("dotenv").config(); | ||
require("module-alias/register"); | ||
|
||
// register extenders | ||
require("@helpers/extenders/Message"); | ||
require("@helpers/extenders/Guild"); | ||
require("@helpers/extenders/GuildChannel"); | ||
|
||
const { checkForUpdates } = require("@helpers/BotUtils"); | ||
const { initializeMongoose } = require("@src/database/mongoose"); | ||
const { BotClient } = require("@src/structures"); | ||
const { validateConfiguration } = require("@helpers/Validator"); | ||
|
||
validateConfiguration(); | ||
|
||
// initialize client | ||
const client = new BotClient(); | ||
client.loadCommands("src/commands"); | ||
client.loadContexts("src/contexts"); | ||
client.loadEvents("src/events"); | ||
|
||
// find unhandled promise rejections | ||
process.on("unhandledRejection", (err) => client.logger.error(`Unhandled exception`, err)); | ||
|
||
(async () => { | ||
// check for updates | ||
await checkForUpdates(); | ||
|
||
// start the dashboard | ||
if (client.config.DASHBOARD.enabled) { | ||
client.logger.log("Launching dashboard"); | ||
try { | ||
const { launch } = require("@root/dashboard/app"); | ||
|
||
// let the dashboard initialize the database | ||
await launch(client); | ||
} catch (ex) { | ||
client.logger.error("Failed to launch dashboard", ex); | ||
} | ||
} else { | ||
// initialize the database | ||
await initializeMongoose(); | ||
} | ||
|
||
// start the client | ||
await client.login(process.env.BOT_TOKEN); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
module.exports = { | ||
OWNER_IDS: [], // Bot owner ID's | ||
SUPPORT_SERVER: "", // Your bot support server | ||
PREFIX_COMMANDS: { | ||
ENABLED: true, // Enable/Disable prefix commands | ||
DEFAULT_PREFIX: "!", // Default prefix for the bot | ||
}, | ||
INTERACTIONS: { | ||
SLASH: false, // Should the interactions be enabled | ||
CONTEXT: false, // Should contexts be enabled | ||
GLOBAL: false, // Should the interactions be registered globally | ||
TEST_GUILD_ID: "xxxxxxxxxxx", // Guild ID where the interactions should be registered. [** Test you commands here first **] | ||
}, | ||
EMBED_COLORS: { | ||
BOT_EMBED: "#068ADD", | ||
TRANSPARENT: "#36393F", | ||
SUCCESS: "#00A56A", | ||
ERROR: "#D61A3C", | ||
WARNING: "#F7E919", | ||
}, | ||
CACHE_SIZE: { | ||
GUILDS: 100, | ||
USERS: 10000, | ||
MEMBERS: 10000, | ||
}, | ||
MESSAGES: { | ||
API_ERROR: "Unexpected Backend Error! Try again later or contact support server", | ||
}, | ||
|
||
// PLUGINS | ||
|
||
AUTOMOD: { | ||
ENABLED: false, | ||
LOG_EMBED: "#36393F", | ||
DM_EMBED: "#36393F", | ||
}, | ||
|
||
DASHBOARD: { | ||
enabled: false, // enable or disable dashboard | ||
baseURL: "http://localhost:8080", // base url | ||
failureURL: "http://localhost:8080", // failure redirect url | ||
port: "8080", // port to run the bot on | ||
}, | ||
|
||
ECONOMY: { | ||
ENABLED: false, | ||
CURRENCY: "₪", | ||
DAILY_COINS: 100, // coins to be received by daily command | ||
MIN_BEG_AMOUNT: 100, // minimum coins to be received when beg command is used | ||
MAX_BEG_AMOUNT: 2500, // maximum coins to be received when beg command is used | ||
}, | ||
|
||
MUSIC: { | ||
ENABLED: false, | ||
IDLE_TIME: 60, // Time in seconds before the bot disconnects from an idle voice channel | ||
MAX_SEARCH_RESULTS: 5, | ||
DEFAULT_SOURCE: "SC", // YT = Youtube, YTM = Youtube Music, SC = SoundCloud | ||
// Add any number of lavalink nodes here | ||
// Refer to https://github.com/freyacodes/Lavalink to host your own lavalink server | ||
LAVALINK_NODES: [ | ||
{ | ||
host: "localhost", | ||
port: 2333, | ||
password: "youshallnotpass", | ||
id: "Local Node", | ||
secure: false, | ||
}, | ||
], | ||
}, | ||
|
||
GIVEAWAYS: { | ||
ENABLED: false, | ||
REACTION: "🎁", | ||
START_EMBED: "#FF468A", | ||
END_EMBED: "#FF468A", | ||
}, | ||
|
||
IMAGE: { | ||
ENABLED: false, | ||
BASE_API: "https://strangeapi.fun/api", | ||
}, | ||
|
||
INVITE: { | ||
ENABLED: false, | ||
}, | ||
|
||
MODERATION: { | ||
ENABLED: false, | ||
EMBED_COLORS: { | ||
TIMEOUT: "#102027", | ||
UNTIMEOUT: "#4B636E", | ||
KICK: "#FF7961", | ||
SOFTBAN: "#AF4448", | ||
BAN: "#D32F2F", | ||
UNBAN: "#00C853", | ||
VMUTE: "#102027", | ||
VUNMUTE: "#4B636E", | ||
DEAFEN: "#102027", | ||
UNDEAFEN: "#4B636E", | ||
DISCONNECT: "RANDOM", | ||
MOVE: "RANDOM", | ||
}, | ||
}, | ||
|
||
PRESENCE: { | ||
ENABLED: false, // Whether or not the bot should update its status | ||
STATUS: "online", // The bot's status [online, idle, dnd, invisible] | ||
TYPE: "WATCHING", // Status type for the bot [PLAYING | LISTENING | WATCHING | COMPETING] | ||
MESSAGE: "{members} members in {servers} servers", // Your bot status message | ||
}, | ||
|
||
STATS: { | ||
ENABLED: false, | ||
XP_COOLDOWN: 5, // Cooldown in seconds between messages | ||
DEFAULT_LVL_UP_MSG: "{member:tag}, You just advanced to **Level {level}**", | ||
}, | ||
|
||
SUGGESTIONS: { | ||
ENABLED: false, // Should the suggestion system be enabled | ||
EMOJI: { | ||
UP_VOTE: "⬆️", | ||
DOWN_VOTE: "⬇️", | ||
}, | ||
DEFAULT_EMBED: "#4F545C", | ||
APPROVED_EMBED: "#43B581", | ||
DENIED_EMBED: "#F04747", | ||
}, | ||
|
||
TICKET: { | ||
ENABLED: false, | ||
CREATE_EMBED: "#068ADD", | ||
CLOSE_EMBED: "#068ADD", | ||
}, | ||
}; |