-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
32 lines (26 loc) · 770 Bytes
/
bot.js
File metadata and controls
32 lines (26 loc) · 770 Bytes
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
//.disable
const discord = require("discord.js");
const botconfig = require("./util/botconfig.json");
const bot = new discord.Client({disableEveryone: true});
const {CommandHandler} = require("djs-commands")
const CH = new CommandHandler({
folder: __dirname + "/commands/",
prefix: [botconfig.prefix]
});
bot.on("ready", () => {
console.log(`Logged in as ${bot.user.tag} on ${bot.guilds.size} servers`)
})
bot.on("message", (message) => {
// if(message.channel.type === "dm") return;
if(message.author.type === "bot") return;
let args = message.content.split(" ");
let command = args[0];
let cmd = CH.getCommand(command);
if(!cmd) return;
try{
cmd.run(bot,message,args)
}catch(e){
console.log(e)
}
});
bot.login("token");