mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-03 04:52:04 -04:00
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.
16 lines
510 B
C#
16 lines
510 B
C#
using System.Text.RegularExpressions;
|
|
using KfChatDotNetBot.Models.DbModels;
|
|
using KfChatDotNetWsClient.Models.Events;
|
|
|
|
namespace KfChatDotNetBot.Commands;
|
|
|
|
internal interface ICommand
|
|
{
|
|
List<Regex> Patterns { get; }
|
|
// Set to null to disable help for a given command
|
|
string? HelpText { get; }
|
|
UserRight RequiredRight { get; }
|
|
TimeSpan Timeout { get; }
|
|
|
|
Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx);
|
|
} |