Skip to content

Commit

Permalink
Fix imports and add conditional check for button interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Jan 2, 2024
1 parent 8dcbbc0 commit 8fd3159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/events/client/InteractionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
InteractionType,
PermissionFlagsBits,
} from 'discord.js';
import { LoadType } from 'shoukaku';

import { Context, Event, Lavamusic } from '../../structures/index.js';
import { LoadType } from 'shoukaku';

export default class InteractionCreate extends Event {
constructor(client: Lavamusic, file: string) {
Expand Down
3 changes: 2 additions & 1 deletion src/events/client/SetupButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class SetupButtons extends Event {
}
public async run(interaction: any): Promise<void> {
if (!interaction.replied) await interaction.deferReply().catch(() => { });

if (!interaction.member.voice.channel)
return await buttonReply(
interaction,
Expand Down Expand Up @@ -70,7 +71,7 @@ export default class SetupButtons extends Event {
} - Requested by ${player.current.info.requester}`
)
.setImage(icon);

if (!interaction.isButton()) return;
if (message) {
switch (interaction.customId) {
case 'LOW_VOL_BUT': {
Expand Down

0 comments on commit 8fd3159

Please sign in to comment.