-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.js
66 lines (56 loc) · 1.85 KB
/
master.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const { Intents, Client, Collection } = require("discord.js");
const { DisTube } = require('distube');
const { SoundCloudPlugin } = require('@distube/soundcloud');
const { SpotifyPlugin } = require('@distube/spotify');
const express = require('express')
const app = express();
const port = 3000
app.get('/', (req, res) => res.send('Master Dev Centre'))
app.listen(port, () =>
console.log(`Master Dev Centre.`)
);
class MainClient extends Client {
constructor() {
super({
shards: "auto",
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
},
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MESSAGES
],
});
process.on('unhandledRejection', error => console.log(error));
process.on('uncaughtException', error => console.log(error));
this.config = require('./settings/config.js');
this.prefix = this.config.PREFIX;
this.owner = this.config.OWNER_ID;
if(!this.token) this.token = this.config.TOKEN;
const client = this;
this.distube = new DisTube(client, {
searchSongs: 0,
searchCooldown: 30,
leaveOnEmpty: this.config.LEAVE_EMPTY,
emptyCooldown: this.config.EMPTY_LEAVE,
leaveOnFinish: this.config.LEAVE_FINISH,
leaveOnStop: this.config.LEAVE_STOP,
plugins: [
new SoundCloudPlugin(),
new SpotifyPlugin({
emitEventsAfterFetching: true
})],
});
["aliases", "commands"].forEach(x => client[x] = new Collection());
["loadCommands", "loadEvents", "loadDistube"].forEach(x => require(`./handlers/${x}`)(client));
}
connect() {
return super.login(this.token);
};
};
module.exports = MainClient;
//All Copyright Go To Master Dev Centre
//Join Support Server if you need help: https://discord.gg/5RPRWM9RBd