diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index 89c42926..16d2ffcd 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -171,6 +171,11 @@ namespace PluralKit.Bot private async Task MessageReceived(SocketMessage _arg) { + // _client.CurrentUser will be null if we've connected *some* shards but not shard #0 yet + // This will cause an error in WebhookCacheServices so we just workaround and don't process any messages + // until we properly connect. TODO: can we do this without chucking away a bunch of messages? + if (_client.CurrentUser == null) return; + using (SentrySdk.PushScope()) using (var serviceScope = _services.CreateScope()) {