Files
discordjs-verification-bot/events/messageCreate.js
T
2024-02-03 21:32:04 +00:00

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);
})