Skip to content

Commit

Permalink
Fixed bug with respond async vs interation causing double interaction…
Browse files Browse the repository at this point in the history
… send
  • Loading branch information
FeroxFoxxo committed Jan 23, 2024
1 parent 461f95f commit a22c6a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/Music/Commands/Pause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ public async Task Pause()
{
if (Player.State is PlayerState.Paused)
{
await RespondAsync("Player is already paused.");
await RespondInteraction("Player is already paused.");
return;
}

await Player.PauseAsync();
await RespondAsync("Paused.");
await RespondInteraction("Paused.");
}
}
4 changes: 2 additions & 2 deletions backend/Music/Commands/Resume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public async Task Resume()
{
if (Player.State is not PlayerState.Paused)
{
await RespondAsync("Player is not paused.");
await RespondInteraction("Player is not paused.");
return;
}

await Player.ResumeAsync();
await RespondAsync("Resumed.");
await RespondInteraction("Resumed.");
}
}
4 changes: 2 additions & 2 deletions backend/Music/Commands/Stop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public async Task Stop()
{
if (Player.CurrentItem is null)
{
await RespondAsync("Nothing playing!");
await RespondInteraction("Nothing playing!");
return;
}

await Player.StopAsync();
await RespondAsync("Stopped playing.");
await RespondInteraction("Stopped playing.");
}
}
4 changes: 2 additions & 2 deletions backend/Music/Commands/Volume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public async Task Volume(int volume = 100)
{
if (volume is > 1000 or < 0)
{
await RespondAsync("Volume out of range: 0% - 1000%!");
await RespondInteraction("Volume out of range: 0% - 1000%!");
return;
}

await Player.SetVolumeAsync(volume / 100f);
await RespondAsync($"Volume updated: {volume}%");
await RespondInteraction($"Volume updated: {volume}%");
}
}

0 comments on commit a22c6a5

Please sign in to comment.