From 0943a44c281f1ce60982e70371a5fd6570e91788 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 15 Nov 2016 01:31:41 +0100 Subject: [PATCH] runasync -> runandblockasync, runasync is not blocking now (unused) --- src/NadekoBot/NadekoBot.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/NadekoBot/NadekoBot.cs b/src/NadekoBot/NadekoBot.cs index 31da82ab..7da1e109 100644 --- a/src/NadekoBot/NadekoBot.cs +++ b/src/NadekoBot/NadekoBot.cs @@ -49,7 +49,7 @@ namespace NadekoBot } } - public async Task RunAsync(string[] args) + public async Task RunAsync(params string[] args) { SetupLogger(); _log = LogManager.GetCurrentClassLogger(); @@ -60,7 +60,7 @@ namespace NadekoBot Credentials = new BotCredentials(); //create client - Client = new ShardedDiscordClient (new DiscordSocketConfig + Client = new ShardedDiscordClient(new DiscordSocketConfig { AudioMode = Discord.Audio.AudioMode.Outgoing, MessageCacheSize = 10, @@ -79,7 +79,7 @@ namespace NadekoBot //setup DI var depMap = new DependencyMap(); depMap.Add(Localizer); - depMap.Add(Client); + depMap.Add(Client); depMap.Add(CommandService); depMap.Add(Google); @@ -111,8 +111,12 @@ namespace NadekoBot #endif Ready = true; Console.WriteLine(await Stats.Print().ConfigureAwait(false)); + } - await Task.Delay(-1); + public async Task RunAndBlockAsync(params string[] args) + { + await RunAsync(args).ConfigureAwait(false); + await Task.Delay(-1).ConfigureAwait(false); } private void SetupLogger()