From 3e65fcf47b116122e10704a26d36ef79c5093c89 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Mon, 9 Apr 2018 19:17:03 +0200 Subject: Play Audio async --- DiscoBot/Auxiliary/Soundeffects.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'DiscoBot/Auxiliary') diff --git a/DiscoBot/Auxiliary/Soundeffects.cs b/DiscoBot/Auxiliary/Soundeffects.cs index 880753d..eb79177 100644 --- a/DiscoBot/Auxiliary/Soundeffects.cs +++ b/DiscoBot/Auxiliary/Soundeffects.cs @@ -21,7 +21,7 @@ namespace DiscoBot.Auxiliary public static class SoundEffects { - public static Task Play(Sound s) + public static async Task Play(Sound s) { string url = string.Empty; int vol = 256; @@ -51,10 +51,11 @@ namespace DiscoBot.Auxiliary if (url != string.Empty) { - return Voice.SendAsync(url, vol); + await Task.Run(() => Voice.SendAsync(url, vol)); + return; } - return Dsa.GeneralContext.Channel.SendMessageAsync("Ton Existiert nicht"); + await Dsa.GeneralContext.Channel.SendMessageAsync("Ton Existiert nicht"); } } } -- cgit v1.2.3-70-g09d2