feat: set shard status to offline when starting up

This commit is contained in:
spiral
2021-11-28 20:50:13 -05:00
parent d2f29bbb51
commit d195c80d92
2 changed files with 8 additions and 0 deletions

View File

@@ -51,6 +51,12 @@ public class Init
var bot = services.Resolve<Bot>();
bot.Init();
// if we're running single-process, clear any existing shard status from the database
var config = services.Resolve<BotConfig>();
var repo = services.Resolve<ModelRepository>();
if (config.Cluster == null)
await repo.ClearShardStatus();
// Start the Discord shards themselves (handlers already set up)
logger.Information("Connecting to Discord");
await StartCluster(services);