-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (20 loc) · 821 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
const { Client } = require('discord-js');
var json = require('./config.json');
require('dotenv').config();
const prefix = json.configs.prefix;
const intents = json.configs.intents;
const client = new Client({intents = intents});
client.on('message', async (message) => {
if (message.author.client) return;
if (message.channel.type === 'dm') return;
if (message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).trim().split(/ +/);
const commandName = args.shift().toLowerCase();
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
if(!command) return;
}
});
client.once('ready', () => {
console.log('Estou on-line!');
})
client.login(process.env.TOKEN)