From 7cd3939f954f49ab12d516c211aa889f9d648be1 Mon Sep 17 00:00:00 2001 From: alyssa Date: Sat, 22 Mar 2025 15:38:21 +0000 Subject: [PATCH] feat(bot): add config setting to disable connecting to discord gateway --- PluralKit.Bot/BotConfig.cs | 1 + PluralKit.Bot/Init.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/BotConfig.cs b/PluralKit.Bot/BotConfig.cs index a9db7233..0be554a1 100644 --- a/PluralKit.Bot/BotConfig.cs +++ b/PluralKit.Bot/BotConfig.cs @@ -25,6 +25,7 @@ public class BotConfig public bool HttpUseInnerCache { get; set; } = false; public string? HttpListenerAddr { get; set; } + public bool DisableGateway { get; set; } = false; public string? DiscordBaseUrl { get; set; } public string? AvatarServiceUrl { get; set; } diff --git a/PluralKit.Bot/Init.cs b/PluralKit.Bot/Init.cs index f19576de..c3046aa9 100644 --- a/PluralKit.Bot/Init.cs +++ b/PluralKit.Bot/Init.cs @@ -84,9 +84,11 @@ public class Init services.Resolve().Start(config.HttpListenerAddr); // Start the Discord shards themselves (handlers already set up) - logger.Information("Connecting to Discord"); - await StartCluster(services); - + if (!config.DisableGateway) + { + logger.Information("Connecting to Discord"); + await StartCluster(services); + } logger.Information("Connected! All is good (probably)."); // Lastly, we just... wait. Everything else is handled in the DiscordClient event loop