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

@@ -19,7 +19,7 @@ public class GetRestreamCommand : ICommand
CancellationToken ctx)
{
var url = await Helpers.GetValue(BuiltIn.Keys.RestreamUrl);
botInstance.SendChatMessage($"@{message.Author.Username}, restream URL: {url.Value}", true);
await botInstance.SendChatMessageAsync($"@{message.Author.Username}, restream URL: {url.Value}", true);
}
}
@@ -38,7 +38,7 @@ public class SetRestreamCommand : ICommand
CancellationToken ctx)
{
await Helpers.SetValue(BuiltIn.Keys.RestreamUrl, arguments["url"].Value);
botInstance.SendChatMessage($"@{message.Author.Username}, updated URL", true);
await botInstance.SendChatMessageAsync($"@{message.Author.Username}, updated URL", true);
}
}