refactor(menu): Made sure the menu can be used for more than group
This commit is contained in:
parent
a79898b2e9
commit
1d73ee8a78
16 changed files with 650 additions and 406 deletions
17
source/Menu/Modals/Prompt.ts
Normal file
17
source/Menu/Modals/Prompt.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import {Modal} from "./Modal";
|
||||
import {Interaction, MessageComponentInteraction, TextInputBuilder} from "discord.js";
|
||||
|
||||
export class Prompt extends Modal {
|
||||
public async requestValue(
|
||||
label: string,
|
||||
field: TextInputBuilder,
|
||||
interaction: MessageComponentInteraction
|
||||
): Promise<string> {
|
||||
const modal = this.getBuilder()
|
||||
.setTitle(label);
|
||||
|
||||
await interaction.showModal(modal);
|
||||
const responseInteraction = await this.awaitResponse();
|
||||
responseInteraction.fields.getTextInputValue()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue