summaryrefslogtreecommitdiff
path: root/DiscoBot/Audio/AudioService.cs
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-06-06 17:10:58 +0200
committerTrueDoctor <d-kobert@web.de>2018-06-06 17:10:58 +0200
commit97450e451fe535bccec1651b9960dd0f446736f3 (patch)
treeea7f71994687c505505c5c7070f659b9be15d529 /DiscoBot/Audio/AudioService.cs
parent7f55f6f289b5ab5b7fd4ac42b472b51a9a0e679e (diff)
fixed some async stuff
Diffstat (limited to 'DiscoBot/Audio/AudioService.cs')
-rw-r--r--DiscoBot/Audio/AudioService.cs10
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))