-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
34 lines (29 loc) · 1.22 KB
/
index.js
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
const { Client, GatewayIntentBits, Collection } = require('discord.js');
const { Connectors } = require("shoukaku");
const { Kazagumo, Plugins } = require("kazagumo");
const client = new Client({
shards: "auto",
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates
],
allowedMentions: { parse: ["users", "roles"] },
});
client.config = require("./settings/config.js");
client.prefix = client.config.PREFIX;
client.owner = client.config.OWNER_ID;
client.color = client.config.EMBED_COLOR;
if(!client.token) client.token = client.config.TOKEN;
client.manager = new Kazagumo({
defaultSearchEngine: client.config.SEARCH_ENGINE, // 'youtube' | 'soundcloud' | 'youtube_music'
plugins: [new Plugins.PlayerMoved(client)],
send: (guildId, payload) => {
const guild = client.guilds.cache.get(guildId);
if (guild) guild.shard.send(payload);
}
}, new Connectors.DiscordJS(client), client.config.NODES);
["commands"].forEach(x => client[x] = new Collection());
["loadCommand", "loadEvent", "loadPlayer", "loadTrack"].forEach(x => require(`./handlers/${x}`)(client));
client.login(client.token);