-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (28 loc) · 865 Bytes
/
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
require("dotenv").config();
const { Client, Collection } = require("discord.js");
const client = new Client({ intents: 32767 });
const { glob } = require("glob");
const { promisify } = require("util");
const PG = promisify(glob);
const Ascii = require("ascii-table");
client.commands = new Collection();
const { DisTube } = require('distube')
const { SpotifyPlugin } = require('@distube/spotify')
client.distube = new DisTube(client, {
emitNewSongOnly:true,
leaveOnFinish:true,
emitAddSongWhenCreatingQueue:false,
plugins: [
new SpotifyPlugin({
api: {
clientId: process.env.spotifyClientID,
clientSecret: process.env.spotifyClientSecret
},
})
]
});
module.exports = client;
["Events", "Commands"].forEach((handler) => {
require(`./Handlers/${handler}`)(client, PG, Ascii);
});
client.login(process.env.token);