Updated ICommandAction.cs and DBEvent.cs. Removed thread request from DBEvent and added special thread request to ICommandAction.cs

This commit is contained in:
2024-07-22 19:20:17 +03:00
parent 08c5febd66
commit 8c338820c5
42 changed files with 691 additions and 26 deletions

View File

@@ -8,15 +8,39 @@ namespace DiscordBotCore.Interfaces;
public interface ICommandAction
{
/// <summary>
/// The name of the action. It is also used to call the action
/// </summary>
public string ActionName { get; }
/// <summary>
/// The description of the action
/// </summary>
public string? Description { get; }
/// <summary>
/// An example or a format of how to use the action
/// </summary>
public string? Usage { get; }
/// <summary>
/// Some parameter descriptions. The key is the parameter name and the value is the description. Supports nesting. Only for the Help command
/// </summary>
public IEnumerable<InternalActionOption> ListOfOptions { get; }
/// <summary>
/// The type of the action. It can be a startup action, a normal action (invoked) or both
/// </summary>
public InternalActionRunType RunType { get; }
/// <summary>
/// Specifies if the action requires another thread to run. This is useful for actions that are blocking the main thread.
/// </summary>
public bool RequireOtherThread { get; }
/// <summary>
/// The method that is invoked when the action is called.
/// </summary>
/// <param name="args">The parameters. Its best practice to reflect the parameters described in <see cref="ListOfOptions"/></param>
public Task Execute(string[]? args);
}