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:
parent
0ec5e37286
commit
a9b0902a01
3 changed files with 18 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue