From 0eb2e8be6f18cdea222cd8d4b49223f020f11d5a Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 8 Mar 2020 11:10:05 +0100 Subject: [PATCH] Skip messages before current user ID is established --- PluralKit.Bot/Bot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index ec32a125..73af28cc 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -260,7 +260,7 @@ namespace PluralKit.Bot public async Task HandleMessage(SocketMessage arg) { var shard = _client.GetShardFor((arg.Channel as IGuildChannel)?.Guild); - if (shard.ConnectionState != ConnectionState.Connected) + if (shard.ConnectionState != ConnectionState.Connected || _client.CurrentUser == null) return; // Discard messages while the bot "catches up" to avoid unnecessary CPU pressure causing timeouts RegisterMessageMetrics(arg);