All the ancillary services have been moved out of the chatbot's class and relocated to a separate file. THe code is still very messy but at least it'll make the main bot easier to navigate.

Also refactored a bunch of shit
* Removed the thread used for pinging, now an async timer
* Kick will no longer block the bot from starting
* Twitch initialization follows the same rules as other services where everything is contained to its build method
* Fixed a bug where the bot's heartbeat logic would get messed up by the machine timezone if it wasn't UTC
This commit is contained in:
barelyprofessional
2024-09-01 00:53:44 +08:00
parent 81a510120d
commit e4b1821a5b
3 changed files with 670 additions and 607 deletions

View File

@@ -15,7 +15,7 @@ public class TempEnableDiscordRelayingCommand : ICommand
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilyBypassGambaSeshForDiscord = true;
botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord = true;
botInstance.SendChatMessage("Enjoy Discord messages, stalker child", true);
}
}
@@ -31,7 +31,7 @@ public class TempSuppressGambaMessages : ICommand
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilySuppressGambaMessages = true;
botInstance.BotServices.TemporarilySuppressGambaMessages = true;
botInstance.SendChatMessage("No more gamba notifs", true);
}
}
@@ -47,7 +47,7 @@ public class EnableGambaMessages : ICommand
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilySuppressGambaMessages = false;
botInstance.BotServices.TemporarilySuppressGambaMessages = false;
botInstance.SendChatMessage("Gamba notifs back on the menu", true);
}
}