Converted send message method to async (also created a synchronous method that shadows the async method). Added a method to send multiple messages at once and message truncation with a choice of strategies

This commit is contained in:
barelyprofessional
2024-09-17 00:57:11 +08:00
parent 4753783c41
commit 5b3f394c29
14 changed files with 152 additions and 49 deletions

View File

@@ -16,7 +16,7 @@ public class TempEnableDiscordRelayingCommand : ICommand
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord = true;
botInstance.SendChatMessage("Enjoy Discord messages, stalker child", true);
await botInstance.SendChatMessageAsync("Enjoy Discord messages, stalker child", true);
}
}
@@ -32,7 +32,7 @@ public class TempSuppressGambaMessages : ICommand
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.BotServices.TemporarilySuppressGambaMessages = true;
botInstance.SendChatMessage("No more gamba notifs", true);
await botInstance.SendChatMessageAsync("No more gamba notifs", true);
}
}
@@ -48,6 +48,6 @@ public class EnableGambaMessages : ICommand
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.BotServices.TemporarilySuppressGambaMessages = false;
botInstance.SendChatMessage("Gamba notifs back on the menu", true);
await botInstance.SendChatMessageAsync("Gamba notifs back on the menu", true);
}
}