This commit is contained in:
amy 2025-05-14 20:23:33 +03:30
parent 6ff915efca
commit 7d035b1479
No known key found for this signature in database

58
src/commands/loss.ts Normal file
View file

@ -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<MessageActionRowComponentBuilder>()
.addComponents(
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("|")
.setCustomId("a"),
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("|i")
.setCustomId("b"),
),
)
.addActionRowComponents(
new ActionRowBuilder<MessageActionRowComponentBuilder>()
.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
]);
}