From 01cc6e52d58f743d7e0afc1b25e207098cc6b592 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 3 Mar 2022 01:42:22 +0100 Subject: [PATCH] Enabled client log everywhere which could hopefully print login errors --- src/NadekoBot/Bot.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/NadekoBot/Bot.cs b/src/NadekoBot/Bot.cs index 195b274b4..6fb3ef781 100644 --- a/src/NadekoBot/Bot.cs +++ b/src/NadekoBot/Bot.cs @@ -64,7 +64,7 @@ public sealed class Bot AlwaysResolveStickers = false, AlwaysDownloadDefaultStickers = false, GatewayIntents = GatewayIntents.All, - LogGatewayIntentWarnings = false + LogGatewayIntentWarnings = false, }); _commandService = new(new() @@ -75,9 +75,7 @@ public sealed class Bot // _interactionService = new(Client.Rest); -#if GLOBAL_NADEKO || DEBUG Client.Log += Client_Log; -#endif } @@ -236,10 +234,10 @@ public sealed class Bot Log.Information("Shard {ShardId} logging in ...", Client.ShardId); try { + Client.Ready += SetClientReady; + await Client.LoginAsync(TokenType.Bot, token); - Log.Information("Starting..."); await Client.StartAsync(); - Log.Information("Started"); } catch (HttpException ex) { @@ -251,10 +249,10 @@ public sealed class Bot LoginErrorHandler.Handle(ex); Helpers.ReadErrorAndExit(4); } - - Client.Ready += SetClientReady; - await clientReady.Task; + + await clientReady.Task.ConfigureAwait(false); Client.Ready -= SetClientReady; + Client.JoinedGuild += Client_JoinedGuild; Client.LeftGuild += Client_LeftGuild;