text response for default
This commit is contained in:
parent
b940741c2f
commit
ef9c9468f2
1 changed files with 13 additions and 25 deletions
|
@ -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" },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue