-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (36 loc) · 1.22 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
require('dotenv').config();
const path = require('path');
const { prefix, suggestionChannel } = require('./config.json');
const Commando = require('discord.js-commando');
const client = new Commando.CommandoClient({
owner: process.env.OWNER_ID,
commandPrefix: prefix
});
client.once('ready', () => {
console.log(`${client.user.username} has logged in`);
client.user.setPresence({
activity: {
name: 'without frameworks'
},
status: 'online'
});
client.registry
.registerGroups([
['info', 'commands providing informations'],
['giveaways', 'commands providing giveaway functions'],
['voting', 'commands for polls, starboards etc']
])
.registerCommandsIn(path.join(__dirname, 'commands'));
});
client.on('message', (message) => {
if(message.mentions.users.first() && message.mentions.users.first().username === 'Vanilla') {
message.reply('Il prefisso per i comandi è `js`. Prova `jshelp` 😉');
}
if (message.channel.name == suggestionChannel && !message.author.bot) {
if (!(message.content.startsWith('jssuggest') || message.content.startsWith('jsplz'))) {
message.delete();
}
}
})
client.on('error', console.error);
client.login(process.env.VANILLA_BOT_TOKEN);