-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (38 loc) · 1.29 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Credits: Kaj on Youtube (he is an underrated mf) + zach.#7777
const { Client, GatewayIntentBits, Partials, GuildScheduledEvent, Guild, Collection } = require('discord.js')
const logs = require('discord-logs')
const {forEach} = require('fs')
const {handleLogs} = require('./handlers/handleLogs')
const {loadEvents} = require('./handlers/eventHandler')
const {loadCommands} = require('./handlers/commandHandler')
const client = new Client({
shards: "auto",
intents: [Object.keys(GatewayIntentBits)],
partials: [Object.keys(Partials)]
});
logs(client, {
debug: true
})
client.commands = new Collection()
client.config = require('./configs/config.json')
const { DisTube } = require('distube')
const { SpotifyPlugin } = require('@distube/spotify')
client.distube = new DisTube(client, {
emitNewSongOnly: true,
leaveOnFinish: true,
nsfw: true,
emitAddSongWhenCreatingQueue: true,
emptyCooldown: 300,
plugins: [new SpotifyPlugin()]
});
client.giveawaysConfig = require('./configs/config.js')
const handlers = ['giveawaysEventsHandler', 'giveawaysManager']
handlers.forEach((x) => {
require(`./utils/${x}`)(client);
})
module.exports = client;
client.login(client.config.token).then(() => {
loadEvents(client);
loadCommands(client);
handleLogs(client);
})