mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated commands to remove the hide from help property, instead set the help text to null for whenever that eventually gets implemented.
Also refactored the way tasks are handled so instead of adding to an array and checking in on them next time someone sends a message, it instead delegates it to a very basic async handler that'll await the command, report errors and kill the task if it takes too long.
This commit is contained in:
@@ -11,10 +11,9 @@ public class WhoisCommand : ICommand
|
||||
new Regex("^whois (?<user>.+)")
|
||||
];
|
||||
|
||||
public string HelpText => "Lookup user IDs by username";
|
||||
public bool HideFromHelp => false;
|
||||
public string? HelpText => "Lookup user IDs by username";
|
||||
public UserRight RequiredRight => UserRight.Guest;
|
||||
|
||||
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
|
||||
{
|
||||
await using var db = new ApplicationDbContext();
|
||||
|
||||
Reference in New Issue
Block a user