Changed the file structure to make the command reading process clearer and improve organization

This commit is contained in:
ION606
2022-05-13 22:29:54 +03:00
parent 21040344ae
commit 2e6d41e76b
14 changed files with 13 additions and 38 deletions
+21
View File
@@ -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");
}
}
}
}