This repository was archived by the owner on Mar 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
58 lines (54 loc) · 1.8 KB
/
index.js
File metadata and controls
58 lines (54 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const { Client, Partials, GatewayIntentBits, Collection } = require("discord.js");
const SynthClient = Client;
const SynthBot = new SynthClient({
shards: "auto",
allowedMentions: {
everyone: false,
roles: false,
users: false
},
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
],
});
const { Player } = require("discord-player");
const { readdirSync } = require("fs");
//Adding The Music Manager
SynthBot.manager = new Player(SynthBot);
//Defining Some Globals With The Help Of Client
SynthBot.commands = new Collection();
SynthBot.slashCommands = new Collection();
SynthBot.aliases = new Collection();
SynthBot.cooldowns = new Collection();
SynthBot.config = require("./synthmusic.config.js");
SynthBot.runfix = SynthBot.config.Bot.Prefix;
SynthBot.emoji = require("./emoji.json");
//Loading The Specific Handler Which Name's Are In Array
[ "Commands", "SlashCommands", "ClientEvents", "PlayerEvents", "Mongoose", "HandlingError" ].forEach((Handler) => {
try {
require(`./Handler/${Handler}`)(SynthBot).then(() => {
console.log(`[HANDLER] Loaded ${Handler} System`)
});
} catch (e) {
console.log(`Error Found In Handler Called ${Handler}\nError:- ${e}`)
}
});
if (!SynthBot.config.Bot.Token) {
console.log(`[SynthBot] TokenError: No Token Was Found In The Config`)
} else {
try {
SynthBot.login(SynthBot.config.Bot.Token)
} catch (e) {
console.log(`[SynthBot] TokenError: The Token Which Was Supplied To Bot Is Invalid`)
}
}