aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-30 21:36:34 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-30 21:36:34 -0500
commit5481971d8dae490a467dd592ca301e72acb2254a (patch)
tree4fe3c5b5f50b8d0eda04018f8906ec806b1d9b56 /src/lib/common
parent83db032fb91996c926a5d007a9e5fa4abed65871 (diff)
downloadtanzanite-5481971d8dae490a467dd592ca301e72acb2254a.tar.gz
tanzanite-5481971d8dae490a467dd592ca301e72acb2254a.tar.bz2
tanzanite-5481971d8dae490a467dd592ca301e72acb2254a.zip
A bit of fixing
Diffstat (limited to 'src/lib/common')
-rw-r--r--src/lib/common/ConfirmationPrompt.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/common/ConfirmationPrompt.ts b/src/lib/common/ConfirmationPrompt.ts
index 9e790c7..a4acf83 100644
--- a/src/lib/common/ConfirmationPrompt.ts
+++ b/src/lib/common/ConfirmationPrompt.ts
@@ -33,38 +33,36 @@ export class ConfirmationPrompt {
new MessageActionRow().addComponents(
new MessageButton({
style: MessageButtonStyles.SUCCESS,
- customId: 'confirmationPrompt__confirm',
+ customId: 'confirmationPrompt_confirm',
emoji: util.emojis.successFull,
label: 'Yes'
}),
new MessageButton({
style: MessageButtonStyles.DANGER,
- customId: 'confirmationPrompt__deny',
+ customId: 'confirmationPrompt_deny',
emoji: util.emojis.errorFull,
label: 'No'
})
)
];
- const msg = (await this.message.util.reply(this.messageOptions)) as BushMessage;
+ const msg = (await this.message.util.sendNew(this.messageOptions)) as BushMessage;
return await new Promise<boolean>((resolve) => {
let responded = false;
const collector = msg.createMessageComponentCollector({
- filter: (interaction) =>
- ['confirmationPrompt__confirm', 'confirmationPrompt__deny'].includes(interaction.customId) &&
- interaction.message?.id == msg.id,
- time: 300000
+ filter: (interaction) => interaction.message?.id == msg.id,
+ time: 300_000
});
collector.on('collect', async (interaction: MessageComponentInteraction) => {
await interaction.deferUpdate().catch(() => undefined);
if (interaction.user.id == this.message.author.id || client.config.owners.includes(interaction.user.id)) {
- if (interaction.id === 'confirmationPrompt__confirm') {
+ if (interaction.customId === 'confirmationPrompt_confirm') {
resolve(true);
responded = true;
collector.stop();
- } else if (interaction.id === 'confirmationPrompt__deny') {
+ } else if (interaction.customId === 'confirmationPrompt_deny') {
resolve(false);
responded = true;
collector.stop();