-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
75 lines (65 loc) · 2.17 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
64
65
66
67
68
69
70
71
72
73
74
75
const path = require('path');
const {Client, SyncSQLiteProvider} = require('discord.js-commando');
const Database = require('better-sqlite3');
require('dotenv').config({path: path.join(__dirname, 'data/.env')});
const client = new Client({
owner: '147800635046232064',
commandPrefix: process.env.NODE_ENV === 'development' ? process.env.DEVPREFIX : process.env.PREFIX,
disableEveryone: true,
unknownCommandResponse: false,
selfbot: false,
presence: {
status: 'online',
activity: {
name: '@Sheriff Magnezone help',
type: 'WATCHING',
}
}
});
const database = new Database(path.join(__dirname, 'data/databases/settings.sqlite3'));
client.setProvider(new SyncSQLiteProvider(database));
client.registry
.registerDefaultTypes()
.registerGroups([
['currency', 'Currency Commands'],
['friendcodes', 'Friend Code Commands'],
['info', 'Information Commands'],
['misc', 'Misc Commands'],
['moderation', 'Moderation Commands'],
['owner', 'Owner Commands'],
['pokemon', 'Pokemon Commands'],
['roles', 'Role Commands'],
['rules', 'Rules Commands'],
['splatoon 2 misc', 'Splatoon 2 Misc Commands'],
['splatoon 2 modes', 'Splatoon 2 Modes Commands'],
['switch', 'Nintendo Switch Commands'],
['test', 'Test Commands']
])
.registerDefaultGroups()
.registerDefaultCommands({
help: true,
prefix: true,
ping: true,
eval: true,
commandState: true
})
.registerCommandsIn(path.join(__dirname, 'commands'));
client.on('ready', () => {
console.log('Logged in!');
});
client.on('guildMemberAdd', member => {
const role = member.guild.roles.find(role => role.name === 'Members');
member.roles.add(role);
});
// bot-commands channel id:
client.on('message', message => {
// const botCommandsChannel = this.client.channels.get('419672986669547540');
// if(message.content.startsWith == "p!catch") {
// return;
// }
// if(message.conent.startsWith == "p!") {
// message.reply("All bot commands should be used in <#419672986669547540>.")
// }
});
client.on('error', console.error);
client.login(process.env.NODE_ENV === 'development' ? process.env.DEVTOKEN : process.env.PRODTOKEN);