From 1e2f2f8a0cd791e868acd1cf3a6a9c5f043e7e99 Mon Sep 17 00:00:00 2001 From: amy Date: Fri, 21 Mar 2025 16:38:10 +0330 Subject: [PATCH] stealemoji --- src/commands/stealemoji.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/commands/stealemoji.ts diff --git a/src/commands/stealemoji.ts b/src/commands/stealemoji.ts new file mode 100644 index 0000000..e3778b9 --- /dev/null +++ b/src/commands/stealemoji.ts @@ -0,0 +1,36 @@ +import {Command} from "../command.ts"; +import { + ApplicationIntegrationType, + ChatInputCommandInteraction, + InteractionContextType, Routes, + SlashCommandBuilder +} from "discord.js"; +import {Config} from "../config.ts"; + + +export default class StealEmojiCommand extends Command { + async run(interaction: ChatInputCommandInteraction, config: Config) { + await interaction.deferReply(); + const emoji = interaction.options.getString("emoji")!; + const emojiname = interaction.options.getString("emojiname")!; + interaction.client.application.emojis.create({ + attachment: emoji, + name: emojiname, + }).then(emoji => interaction.followUp(`Created new emoji with name ${emoji.name}`)) + .catch(console.error); + } + + slashCommand = new SlashCommandBuilder() + .setName("stealemoji") + .setDescription("steal the emojer") + .addStringOption(option => option.setName("emojiname").setRequired(true).setDescription("emoji name")) + .addStringOption(option => option.setName("emoji").setRequired(true).setDescription("emoji link")) + .setIntegrationTypes([ + ApplicationIntegrationType.UserInstall + ]) + .setContexts([ + InteractionContextType.BotDM, + InteractionContextType.Guild, + InteractionContextType.PrivateChannel + ]); +}