-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (26 loc) · 959 Bytes
/
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
const { Client } = require("discord.js");
const { config } = require("dotenv");
const botconfig = require('./config.json');
const cmdBonk = require('./src/commands/bonk');
//Previnir que o client tem a permissão de pingar @everyone
const client = new Client({
disableEveryone: true
});
config({
path: __dirname + "/.env"
})
const prefix = botconfig.prefix;
client.on("ready", () => {
console.log(`Olá, ${client.user.username} estou online!`);
client.user.setActivity("b!bonk <mention a user>", { type: "WATCHING" })
})
client.on("message", async message => {
if (message.author.bot) return;
if (!message.guild) return;
if (!message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
const ownIdBot = client.user.id;
await cmdBonk.bonk(cmd, message, args, ownIdBot);
});
client.login(process.env.TOKEN);