Skip to content

Commit

Permalink
Playback will stop if all users left in a VC are bots.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emzi0767 committed Aug 16, 2020
1 parent d745f94 commit ba93c27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Emzi0767.MusicTurret/Emzi0767.MusicTurret.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.5.11</Version>
<Version>1.5.12</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<AssemblyTitle>Music Turret Discord Bot</AssemblyTitle>
Expand Down
2 changes: 1 addition & 1 deletion Emzi0767.MusicTurret/TurretBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private async Task Discord_VoiceStateUpdated(VoiceStateUpdateEventArgs e)
return;

var usrs = chn.Users;
if (gmd.IsPlaying && usrs.Count() == 1 && usrs.First() == this.Discord.CurrentUser)
if (gmd.IsPlaying && !usrs.Any(x => !x.IsBot))
{
e.Client.DebugLogger.LogMessage(LogLevel.Info, LOG_TAG, $"All users left voice in {e.Guild.Name}, pausing playback", DateTime.Now);
await gmd.PauseAsync();
Expand Down

0 comments on commit ba93c27

Please sign in to comment.