From 7d035b1479800d51da741786241332efccec6d4d Mon Sep 17 00:00:00 2001 From: amy Date: Wed, 14 May 2025 20:23:33 +0330 Subject: [PATCH] loss --- src/commands/loss.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/commands/loss.ts diff --git a/src/commands/loss.ts b/src/commands/loss.ts new file mode 100644 index 0000000..43eebac --- /dev/null +++ b/src/commands/loss.ts @@ -0,0 +1,58 @@ +import {Command} from "../command.ts"; +import { + ActionRowBuilder, + ApplicationIntegrationType, ButtonBuilder, ButtonStyle, + ChatInputCommandInteraction, ContainerBuilder, + InteractionContextType, type MessageActionRowComponentBuilder, MessageFlags, + SlashCommandBuilder +} from "discord.js"; +import { type Config } from "../config.ts"; + +export default class LossCommand extends Command { + async run(interaction: ChatInputCommandInteraction, config: Config) { + const components = [ + new ContainerBuilder() + .addActionRowComponents( + new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setStyle(ButtonStyle.Secondary) + .setLabel("|") + .setCustomId("a"), + new ButtonBuilder() + .setStyle(ButtonStyle.Secondary) + .setLabel("|i") + .setCustomId("b"), + ), + ) + .addActionRowComponents( + new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setStyle(ButtonStyle.Secondary) + .setLabel("||") + .setCustomId("c"), + new ButtonBuilder() + .setStyle(ButtonStyle.Secondary) + .setLabel("|_") + .setCustomId("d"), + ), + ), + ]; + await interaction.reply({ + components: components, + flags: [MessageFlags.IsComponentsV2], + }); + } + + slashCommand = new SlashCommandBuilder() + .setName("loss") + .setDescription("why").setIntegrationTypes([ + ApplicationIntegrationType.UserInstall + ]) + .setContexts([ + InteractionContextType.BotDM, + InteractionContextType.Guild, + InteractionContextType.PrivateChannel + ]); +}