From 97450e451fe535bccec1651b9960dd0f446736f3 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Wed, 6 Jun 2018 17:10:58 +0200 Subject: fixed some async stuff --- DiscoBot/Audio/AudioService.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'DiscoBot/Audio/AudioService.cs') 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)) -- cgit v1.2.3-70-g09d2