Skip to content

Commit

Permalink
fix: Move playback manipulation check to after timestamp.
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern committed Feb 6, 2023
1 parent 2bc8751 commit 5eb87d5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/commands/music/commands/skip-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ async function handleSkipToTimestamp(
const controller = client.features.music.controllers.get(interaction.guildId!);
if (controller === undefined) return;

const isVoiceStateVerified = verifyCanManipulatePlayback(
bot,
interaction,
controller,
getVoiceState(client, interaction.guildId!, interaction.user.id),
);
if (!isVoiceStateVerified) return;

const [{ timestamp: timestampExpression }, focused] = parseArguments(interaction.data?.options, {});

if (focused !== undefined) {
Expand All @@ -55,6 +47,14 @@ async function handleSkipToTimestamp(
);
}

const isVoiceStateVerified = verifyCanManipulatePlayback(
bot,
interaction,
controller,
getVoiceState(client, interaction.guildId!, interaction.user.id),
);
if (!isVoiceStateVerified) return;

const playingSince = controller.player.playingSince!;

if (!isOccupied(controller.player)) {
Expand Down

0 comments on commit 5eb87d5

Please sign in to comment.