mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-05 23:06:14 +00:00
Transitioned all Misc, audio, Selmer Specific, admin, anime/manga, and inventory commands to Slash Command format. The RSS and reactionrole commands are still broken and all game commands are still in message format due to compications
This commit is contained in:
Vendored
+25
-20
@@ -1,3 +1,5 @@
|
||||
//NOTE: THIS FUNCTION REQUIRES REPLIES, AND I CAN'T FIGURE OUT HOW TO LINK THEM TO SLASH COMMANDS
|
||||
|
||||
module.exports = {
|
||||
name: 'react',
|
||||
description: "Reacts with a phrase or single emoji",
|
||||
@@ -8,31 +10,34 @@ module.exports = {
|
||||
if (message.reference) {
|
||||
msg = await message.channel.messages.fetch(message.reference.messageId);
|
||||
} else { msg = message; }
|
||||
//Get rid of any custom emojis
|
||||
console.log("IMPLEMENT THIS");
|
||||
|
||||
let emoji = [...new Set(args[0])];
|
||||
if (emoji.length > 15 /*|| message.IndexOf(":") != -1*/) { return message.reply("Please enter less than 15 emojis"); }
|
||||
let notused = new Array(15);
|
||||
let counter = 0;
|
||||
try {
|
||||
let emoji = [...new Set(args[0])];
|
||||
if (emoji.length > 15 /*|| message.IndexOf(":") != -1*/) { return message.reply("Please enter less than 15 emojis"); }
|
||||
let notused = new Array(15);
|
||||
let counter = 0;
|
||||
|
||||
for (let i = 0; i < emoji.length; i ++) {
|
||||
try {
|
||||
await msg.react(emoji[i]);
|
||||
} catch(err) {
|
||||
//The emoji wasn't a valid one
|
||||
notused[counter] = emoji[i];
|
||||
counter ++;
|
||||
for (let i = 0; i < emoji.length; i ++) {
|
||||
try {
|
||||
await msg.react(emoji[i]);
|
||||
} catch(err) {
|
||||
//The emoji wasn't a valid one
|
||||
notused[counter] = emoji[i];
|
||||
counter ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (notused.length > 0) {
|
||||
notused = notused.filter(element => element !== undefined);
|
||||
if (notused.length > 1) {
|
||||
message.reply("These are not valid reaction emoji(s): " + notused.toString());
|
||||
} else {
|
||||
message.reply(notused.toString() + " is not a valid reaction emoji");
|
||||
if (notused.length > 0) {
|
||||
notused = notused.filter(element => element !== undefined);
|
||||
if (notused.length > 1) {
|
||||
message.reply("These are not valid reaction emoji(s): " + notused.toString());
|
||||
} else {
|
||||
message.reply(notused.toString() + " is not a valid reaction emoji");
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return message.reply("Uh oh, there's been an error");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user