diff options
author | TrueDoctor <d-kobert@web.de> | 2018-04-09 19:17:03 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-04-09 19:17:03 +0200 |
commit | 3e65fcf47b116122e10704a26d36ef79c5093c89 (patch) | |
tree | ca015e7a3f0ddc17b0bc098ec3b9bf7da04edfc5 /DiscoBot/Auxiliary | |
parent | 5975fb9de7bb99103aa6e83f7c13834efaddcc7d (diff) |
Play Audio async
Diffstat (limited to 'DiscoBot/Auxiliary')
-rw-r--r-- | DiscoBot/Auxiliary/Soundeffects.cs | 7 |
1 files changed, 4 insertions, 3 deletions
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"); } } } |