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 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 SlashCommand from "../lib/classes/SlashCommand";
|
||||||
import Modal from "../lib/classes/Modal";
|
import Modal from "../lib/classes/Modal";
|
||||||
import { collectModal } from "../lib/handlers/ModalHandler";
|
import { collectModal } from "../lib/handlers/ModalHandler";
|
||||||
|
|
||||||
export default class extends SlashCommand implements Command {
|
export default class extends SlashCommand implements Command {
|
||||||
name = "default";
|
name = "default";
|
||||||
description = "Show a test modal";
|
description = "default";
|
||||||
options = [];
|
options = [];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
async run() {
|
async run(interaction: Interaction) {
|
||||||
const modal = new Modal().setTitle("dope").setComponents([
|
return {
|
||||||
{
|
type: InteractionResponseTypes.UpdateMessage,
|
||||||
type: MessageComponentTypes.ActionRow,
|
data: { content: "my name is terry and im going to destroy thgis world" },
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue