3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

added support for emoji ids on emojiinfo command

This commit is contained in:
Almeida 2021-05-10 12:23:57 +01:00 committed by almeidx
parent 0ec5e37286
commit a9b0902a01
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664
3 changed files with 18 additions and 18 deletions

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { customEmojiRegex } from "../../../utils";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { getCustomEmojiId } from "../functions/getCustomEmojiId";
import { utilityCmd } from "../types";
export const EmojiInfoCmd = utilityCmd({
@ -15,13 +15,13 @@ export const EmojiInfoCmd = utilityCmd({
},
async run({ message, args, pluginData }) {
const emojiIdMatch = args.emoji.match(customEmojiRegex);
if (!emojiIdMatch?.[2]) {
const emojiId = getCustomEmojiId(args.emoji);
if (!emojiId) {
sendErrorMessage(pluginData, message.channel, "Emoji not found");
return;
}
const embed = await getEmojiInfoEmbed(pluginData, emojiIdMatch[2]);
const embed = await getEmojiInfoEmbed(pluginData, emojiId);
if (!embed) {
sendErrorMessage(pluginData, message.channel, "Emoji not found");
return;