15 lines
621 B
JavaScript
15 lines
621 B
JavaScript
const { EmbedBuilder, Collection, PermissionsBitField, ChannelType } = require('discord.js');
|
|
const client = require('..');
|
|
const config = require('../config/config.js');
|
|
|
|
client.on('messageCreate', async message => {
|
|
if (message.author.bot) return;
|
|
if (message.channel.type === ChannelType.DM) return;
|
|
if (!message.content.startsWith(config.prefix)) return;
|
|
const args = message.content.slice(config.prefix.length).trim().split(/ +/);
|
|
const cmd = args.shift().toLowerCase();
|
|
if (cmd.length === 0) return;
|
|
const commands = client.commands.get(cmd);
|
|
|
|
commands.run(client, message, args);
|
|
}) |