-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (32 loc) · 1.15 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
const Discord = require('discord.js')
const bot = new Discord.Client()
const { PREFIX, TOKEN, AUTHOR } = require('./config.json')
const fs = require('fs');
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}
bot.on('ready', ()=> {
bot.user.setActivity(`Made by ${AUTHOR}`)
bot.user.setStatus("dnd")
console.log(`${bot.user.username} is online!`)
})
bot.on('message', (message)=> {
let prefix = PREFIX;
if(!message.content.startsWith(prefix) || message.author.bot || message.channel.type != 'text') return;
let MessageArray = message.content.split(' ');
let cmd = MessageArray[0].slice(prefix.length);
let args = MessageArray.slice(1)
if(cmd == "kick") {
bot.commands.get('kick').execute(message, args);
}
if(cmd == "ban") {
bot.commands.get('ban').execute(message, args);
}
if(cmd == "bypass") {
bot.commands.get('assd').execute(message, args);
}
})
bot.login(TOKEN)