main.js
1.25 KB
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
//bot basic primer
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = ';';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('anxietymanager is online')
});
//Command Calls
client.on('message', message => {
if(!message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command == 'ping'){
message.channel.send('pong!');
} else if(command == 'help'){
client.commands.get('help').execute(message, args);
} else if(command == 'calm'){
client.commands.get('calm').execute(message, args, Discord);
} else if(command == 'breathe'){
client.commands.get('breathe').execute(message, args);
} else if(command == 'cute'){
client.commands.get('cute').execute(message, args, Discord);
}
});
client.login('OTgwOTAxNzg3MzY2MjE1Njgw.GVFGdS.z9ily3n-7rcJnqf2FrHg3KJn5h_u68llQzJOGU');