mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Changed the file structure to make the command reading process clearer and improve organization
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
name: 'r',
|
||||
description: "Reacts with a phrase or single emoji",
|
||||
async execute(message, args, Discord, Client, bot) {
|
||||
|
||||
// if (!message.reference) { return; }
|
||||
let msg;
|
||||
if (message.reference) {
|
||||
msg = await message.channel.messages.fetch(message.reference.messageId);
|
||||
} else { msg = message; }
|
||||
|
||||
for (let i = 0; i < args.length; i ++) {
|
||||
try {
|
||||
await msg.react(args[i]);
|
||||
} catch(err) {
|
||||
//The emoji wasn't a valid one
|
||||
message.reply("Please enter a valid emoji");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user