From 238f44967b1cb1a91eb78e000fe040c7c0ba9730 Mon Sep 17 00:00:00 2001 From: Essem Date: Sat, 24 Sep 2022 12:58:59 -0500 Subject: [PATCH] Fix emote, help, and Select Image --- commands/general/emote.js | 2 +- commands/general/help.js | 5 ++--- commands/message/select-image.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/general/emote.js b/commands/general/emote.js index d3685ba..1901e73 100644 --- a/commands/general/emote.js +++ b/commands/general/emote.js @@ -6,7 +6,7 @@ class EmoteCommand extends Command { const emoji = this.options.emoji ?? this.content; if (emoji && emoji.trim() && emoji.split(" ")[0].match(/^$/)) { return `https://cdn.discordapp.com/emojis/${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$2")}.${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$1") === "a" ? "gif" : "png"}`; - } else if (emoji.match(emojiRegex)) { + } else if (emoji.match(emojiRegex())) { const codePoints = []; for (const codePoint of emoji) { codePoints.push(codePoint.codePointAt(0).toString(16)); diff --git a/commands/general/help.js b/commands/general/help.js index 4c94bea..fbfbaee 100644 --- a/commands/general/help.js +++ b/commands/general/help.js @@ -5,8 +5,7 @@ import { random } from "../../utils/misc.js"; import paginator from "../../utils/pagination/pagination.js"; import * as help from "../../utils/help.js"; import Command from "../../classes/command.js"; -const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional.", "esmBot is hosted and paid for completely out-of-pocket by the main developer. If you want to support development, please consider donating! https://patreon.com/TheEssem", "You can run commands in DMs as well, just message the bot with your command - no prefix needed!"]; -const argTypes = Object.keys(Constants.ApplicationCommandOptionTypes); +const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional.", "esmBot is hosted and paid for completely out-of-pocket by the main developer. If you want to support development, please consider donating! https://patreon.com/TheEssem"]; class HelpCommand extends Command { async run() { @@ -43,7 +42,7 @@ class HelpCommand extends Command { const flagInfo = []; for (const flag of info.flags) { if (flag.type === 1) continue; - flagInfo.push(`\`--${flag.name}${flag.type ? `=[${argTypes[flag.type - 1]}]` : ""}\` - ${flag.description}`); + flagInfo.push(`\`--${flag.name}${flag.type ? `=[${Constants.ApplicationCommandOptionTypes[flag.type]}]` : ""}\` - ${flag.description}`); } if (flagInfo.length !== 0) { embed.embeds[0].fields.push({ diff --git a/commands/message/select-image.js b/commands/message/select-image.js index 19c1141..7a62666 100644 --- a/commands/message/select-image.js +++ b/commands/message/select-image.js @@ -4,7 +4,7 @@ import { selectedImages } from "../../utils/collections.js"; class SelectImageCommand extends Command { async run() { - const message = this.interaction.data.resolved.messages.get(this.interaction.data.target_id); + const message = this.interaction.data.target; const image = await imageDetect(this.client, message, this.interaction, this.options, true, false, false, true); this.success = false; if (image === undefined) {