From a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 23 Jan 2022 18:13:05 -0500 Subject: fix discord.js breaking changes, some other stuff --- src/lib/common/ConfirmationPrompt.ts | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/lib/common/ConfirmationPrompt.ts') diff --git a/src/lib/common/ConfirmationPrompt.ts b/src/lib/common/ConfirmationPrompt.ts index a4acf83..97f18b3 100644 --- a/src/lib/common/ConfirmationPrompt.ts +++ b/src/lib/common/ConfirmationPrompt.ts @@ -1,6 +1,5 @@ import { type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageActionRow, MessageButton, type MessageComponentInteraction, type MessageOptions } from 'discord.js'; -import { MessageButtonStyles } from 'discord.js/typings/enums'; +import { ActionRow, ButtonComponent, ButtonStyle, type MessageComponentInteraction, type MessageOptions } from 'discord.js'; /** * Sends a message with buttons for the user to confirm or cancel the action. @@ -30,19 +29,17 @@ export class ConfirmationPrompt { */ protected async send(): Promise { this.messageOptions.components = [ - new MessageActionRow().addComponents( - new MessageButton({ - style: MessageButtonStyles.SUCCESS, - customId: 'confirmationPrompt_confirm', - emoji: util.emojis.successFull, - label: 'Yes' - }), - new MessageButton({ - style: MessageButtonStyles.DANGER, - customId: 'confirmationPrompt_deny', - emoji: util.emojis.errorFull, - label: 'No' - }) + new ActionRow().addComponents( + new ButtonComponent() + .setStyle(ButtonStyle.Primary) + .setCustomId('confirmationPrompt_confirm') + .setEmoji({ id: util.emojis.successFull, name: 'successFull', animated: false }) + .setLabel('Yes'), + new ButtonComponent() + .setStyle(ButtonStyle.Danger) + .setCustomId('confirmationPrompt_cancel') + .setEmoji({ id: util.emojis.errorFull, name: 'errorFull', animated: false }) + .setLabel('No') ) ]; -- cgit