refactor(arabot): remove deprecated options in nonVeganAccess

This commit is contained in:
Anthony Berg
2025-01-18 12:00:50 +01:00
parent e44c0c2037
commit cd4526bfb1

View File

@@ -21,7 +21,11 @@ import {
InteractionHandler, InteractionHandler,
InteractionHandlerTypes, InteractionHandlerTypes,
} from '@sapphire/framework'; } from '@sapphire/framework';
import type { ButtonInteraction, GuildMember } from 'discord.js'; import {
ButtonInteraction,
GuildMember,
MessageFlagsBitField,
} from 'discord.js';
import IDs from '#utils/ids'; import IDs from '#utils/ids';
export class NonVeganAccessButtonHandler extends InteractionHandler { export class NonVeganAccessButtonHandler extends InteractionHandler {
@@ -51,7 +55,7 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
if (member === null) { if (member === null) {
await interaction.reply({ await interaction.reply({
content: errorMessage, content: errorMessage,
ephemeral: true, flags: MessageFlagsBitField.Flags.Ephemeral,
}); });
return; return;
} }
@@ -62,7 +66,7 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
if (!member.roles.cache.has(IDs.roles.vegan.vegan)) { if (!member.roles.cache.has(IDs.roles.vegan.vegan)) {
await interaction.reply({ await interaction.reply({
content: 'You need to be vegan to use this button!', content: 'You need to be vegan to use this button!',
ephemeral: true, flags: MessageFlagsBitField.Flags.Ephemeral,
}); });
return; return;
} }
@@ -73,7 +77,7 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
content: content:
'Your access from the non vegan section has been removed. ' + 'Your access from the non vegan section has been removed. ' +
'If you want to gain access again, click this button again.', 'If you want to gain access again, click this button again.',
ephemeral: true, flags: MessageFlagsBitField.Flags.Ephemeral,
}); });
return; return;
} }
@@ -83,13 +87,13 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
content: content:
'Your access to the non vegan section has been given back. ' + 'Your access to the non vegan section has been given back. ' +
'If you want to remove access again, click this button again.', 'If you want to remove access again, click this button again.',
ephemeral: true, flags: MessageFlagsBitField.Flags.Ephemeral,
}); });
} catch (error) { } catch (error) {
this.container.logger.error(`Non Vegan Access Interaction: ${error}`); this.container.logger.error(`Non Vegan Access Interaction: ${error}`);
await interaction.reply({ await interaction.reply({
content: errorMessage, content: errorMessage,
ephemeral: true, flags: MessageFlagsBitField.Flags.Ephemeral,
}); });
} }
} }