text response for default

This commit is contained in:
cirroskais 2024-04-18 15:05:16 -04:00
parent b940741c2f
commit ef9c9468f2
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D

View file

@ -1,40 +1,28 @@
import type { Command } from "../lib/types/command";
import { MessageComponentTypes, TextStyles } from "@discordeno/bot";
import {
MessageComponentTypes,
TextStyles,
type Interaction,
type InteractionResponse,
InteractionResponseTypes,
} from "@discordeno/bot";
import SlashCommand from "../lib/classes/SlashCommand";
import Modal from "../lib/classes/Modal";
import { collectModal } from "../lib/handlers/ModalHandler";
export default class extends SlashCommand implements Command {
name = "default";
description = "Show a test modal";
description = "default";
options = [];
constructor() {
super();
}
async run() {
const modal = new Modal().setTitle("dope").setComponents([
{
type: MessageComponentTypes.ActionRow,
components: [
{
type: MessageComponentTypes.InputText,
customId: "default",
style: TextStyles.Short,
label: "default",
},
],
},
]);
collectModal(modal)
.then(({ interaction, values }) => {
if (!interaction.data?.components) return;
interaction.respond("default: " + values.get("default"));
})
.catch((_) => {});
return modal;
async run(interaction: Interaction) {
return {
type: InteractionResponseTypes.UpdateMessage,
data: { content: "my name is terry and im going to destroy thgis world" },
};
}
}