Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Oct 19, 2023
1 parent 4f75f3f commit e47023b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/discord/events/buttonClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from '../commands/guild/d.rpg';
import { helperButton } from '../commands/global/d.setup';
import { appealAccept, appealReject } from '../utils/appeal';
import { mushroomPageOne, mushroomPageTwo } from '../commands/global/d.mushroom_info';

const F = f(__filename);

Expand All @@ -34,6 +35,20 @@ export async function buttonClick(interaction:ButtonInteraction, discordClient:C
log.debug(F, 'Interaction deferred!');
const buttonID = interaction.customId;

if (buttonID.startsWith('mushroom')) {
// log.debug(F, 'Werewolf button clicked');

if (buttonID.toLowerCase().includes('pageone')) {
await mushroomPageOne(interaction);
return;
}

if (buttonID.toLowerCase().includes('pagetwo')) {
await mushroomPageTwo(interaction);
return;
}
}

if (buttonID.startsWith('rpg')) {
if (!buttonID.includes(interaction.user.id)) {
log.debug(F, 'Button clicked by someone other than the user who clicked it');
Expand Down

0 comments on commit e47023b

Please sign in to comment.