-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
63 lines (57 loc) · 1.68 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const { CommandoClient } = require('discord.js-commando');
const { Structures } = require('discord.js');
const path = require('path');
const { prefix, token } = require('./config.json');
Structures.extend('Guild', function(Guild) {
class MusicGuild extends Guild {
constructor(client, data) {
super(client, data);
this.musicData = {
queue: [],
isPlaying: false,
nowPlaying: null,
songDispatcher: null,
volume: 1
};
this.triviaData = {
isTriviaRunning: false,
wasTriviaEndCalled: false,
triviaQueue: [],
triviaScore: new Map()
};
}
}
return MusicGuild;
});
const client = new CommandoClient({
commandPrefix: prefix,
owner: '589125712611639318' // change this to your Discord user ID
});
client.registry
.registerDefaultTypes()
.registerGroups([
['music', 'Music Command Group'],
['gifs', 'Gif Command Group'],
['other', 'random types of commands group'],
['guild', 'guild related commands']
])
.registerDefaultGroups()
.registerDefaultCommands({
eval: false,
prefix: false,
commandState: false
})
.registerCommandsIn(path.join(__dirname, 'commands'));
client.once('ready', () => {
console.log('The bot has reloaded and is now ready!');
client.user.setActivity(`${prefix}help `, {
type: 'WATCHING',
url: 'https://github.com/githubfan/TheEverythingBot'
});
});
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.find(ch => ch.name === 'general'); // change this to the channel name you want to send the greeting to
if (!channel) return;
channel.send(`Welcome ${member}!`);
});
client.login(token);