From 075fbd1bb400679a869da69e9133447a1c045aef Mon Sep 17 00:00:00 2001 From: raym55 <100526773+piplup55@users.noreply.github.com> Date: Mon, 20 Jun 2022 06:36:02 +0100 Subject: [PATCH] Update Program.cs --- Server/Program.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Server/Program.cs b/Server/Program.cs index eb368aa..5757f0a 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -456,6 +456,15 @@ CommandHandler.RegisterCommand("loadsettings", _ => { return "Loaded settings.json"; }); +async CommandHandler.RegisterCommand("reconnect", _ => { + // this should be async'ed but i'm lazy + await bot.DisconnectAsync(); + Task.Delay(2500); + await bot.ConnectAsync(); + Task.Delay(1000); + return "reconnected successful"; +}); + Console.CancelKeyPress += (_, e) => { e.Cancel = true; consoleLogger.Info("Received Ctrl+C");