diff options
author | Kobert-P <kassiaK@yahoo.de> | 2018-06-06 17:27:29 +0200 |
---|---|---|
committer | Kobert-P <kassiaK@yahoo.de> | 2018-06-06 17:27:29 +0200 |
commit | 8396bb48937889a708da7ecb35b788fcef4f2eca (patch) | |
tree | a943eada01951e6f2f3095facd087a48b3105c9b /DiscoBot/Audio/AudioService.cs | |
parent | e541bd51f4dd1866129d764ca2fcfcde6240f22b (diff) | |
parent | 0b5fd9f180d9537f81f5dabf7692106a0127f849 (diff) |
Merge branch 'master' of https://github.com/TrueDoctor/DiscoBot
Diffstat (limited to 'DiscoBot/Audio/AudioService.cs')
-rw-r--r-- | DiscoBot/Audio/AudioService.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/DiscoBot/Audio/AudioService.cs b/DiscoBot/Audio/AudioService.cs index 52caf23..6e01980 100644 --- a/DiscoBot/Audio/AudioService.cs +++ b/DiscoBot/Audio/AudioService.cs @@ -16,8 +16,7 @@ public async Task JoinAudio(IGuild guild, IVoiceChannel target) { - IAudioClient client; - if (this.connectedChannels.TryGetValue(guild.Id, out client)) + if (this.connectedChannels.TryGetValue(guild.Id, out var client)) { return; } @@ -39,8 +38,7 @@ public async Task LeaveAudio(IGuild guild) { - IAudioClient client; - if (this.connectedChannels.TryRemove(guild.Id, out client)) + if (this.connectedChannels.TryRemove(guild.Id, out var client)) { await client.StopAsync(); //await Log(LogSeverity.Info, $"Disconnected from voice on {guild.Name}."); @@ -55,8 +53,8 @@ await channel.SendMessageAsync("File does not exist."); return; } - IAudioClient client; - if (this.connectedChannels.TryGetValue(guild.Id, out client)) + + if (this.connectedChannels.TryGetValue(guild.Id, out var client)) { //await Log(LogSeverity.Debug, $"Starting playback of {path} in {guild.Name}"); using (var ffmpeg = this.CreateStream(path)) |