Interface ICommandInfo
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Represent a command information object that can be executed.
public interface ICommandInfo
Properties
Attributes
Gets a collection of the attributes of this command.
IReadOnlyCollection<Attribute> Attributes { get; }
Property Value
CommandService
Gets the the underlying command service.
InteractionService CommandService { get; }
Property Value
IgnoreGroupNames
Gets true if this command will be registered and executed as a standalone command, unaffected by the GroupAttributes of of the commands parents.
bool IgnoreGroupNames { get; }
Property Value
IsTopLevelCommand
Gets true if this command is a top level command and none of its parents have a GroupAttribute.
bool IsTopLevelCommand { get; }
Property Value
MethodName
Gets the name of the command handler method.
string MethodName { get; }
Property Value
Module
Gets the module that the method belongs to.
ModuleInfo Module { get; }
Property Value
Name
Gets the name of the command.
string Name { get; }
Property Value
Parameters
Gets a collection of the parameters of this command.
IReadOnlyCollection<IParameterInfo> Parameters { get; }
Property Value
Preconditions
Gets a collection of the preconditions of this command.
IReadOnlyCollection<PreconditionAttribute> Preconditions { get; }
Property Value
RunMode
Get the run mode this command gets executed with.
RunMode RunMode { get; }
Property Value
SupportsWildCards
Gets whether this command supports wild card patterns.
bool SupportsWildCards { get; }
Property Value
TreatNameAsRegex
bool TreatNameAsRegex { get; }
Property Value
Methods
CheckPreconditionsAsync(IInteractionContext, IServiceProvider)
Check if an execution context meets the command precondition requirements.
Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, IServiceProvider services)
Parameters
context
IInteractionContextservices
IServiceProvider
Returns
ExecuteAsync(IInteractionContext, IServiceProvider)
Executes the command with the provided context.
Task<IResult> ExecuteAsync(IInteractionContext context, IServiceProvider services)
Parameters
context
IInteractionContextThe execution context.
services
IServiceProviderDependencies that will be used to create the module instance.