Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on("message", message => {
- const botID = bot.user.id
- if (message.content.includes(botID)) {
- message.channel.send('My prefix for this server is `+`!')
- }
- if (!message.content.startsWith(prefix) || message.author.bot) return;
- const args = message.content.slice(prefix.length).split(/ +/);
- const commandName = args.shift().toLowerCase();
- const command = bot.commands.get(commandName) || bot.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
- if (!command) return;
- try {
- command.execute(message, args, bot, config);
- } catch (error) {
- console.error(error)
- message.reply('an issue occurred, please contact support if this persists.')
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment