3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00
zeppelin/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts
2024-05-12 21:34:17 +02:00

31 lines
956 B
TypeScript

import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getCustomEmojiId } from "../functions/getCustomEmojiId";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { utilityCmd } from "../types";
export const EmojiInfoCmd = utilityCmd({
trigger: ["emoji", "emojiinfo"],
description: "Show information about an emoji",
usage: "!emoji 106391128718245888",
permission: "can_emojiinfo",
signature: {
emoji: ct.string({ required: true }),
},
async run({ message, args, pluginData }) {
const emojiId = getCustomEmojiId(args.emoji);
if (!emojiId) {
void pluginData.state.common.sendErrorMessage(message, "Emoji not found");
return;
}
const embed = await getEmojiInfoEmbed(pluginData, emojiId);
if (!embed) {
void pluginData.state.common.sendErrorMessage(message, "Emoji not found");
return;
}
message.channel.send({ embeds: [embed] });
},
});