Class SlashCommandInfo
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Represents the info class of an attribute based method for command type Slash.
public class SlashCommandInfo : CommandInfo<SlashCommandParameterInfo>, ICommandInfo, IApplicationCommandInfo- Inheritance
- 
      
      
      SlashCommandInfo
- Implements
- Inherited Members
Properties
CommandType
Gets the type of this command.
public ApplicationCommandType CommandType { get; }Property Value
ContextTypes
Gets the context types this command can be executed in.
public IReadOnlyCollection<InteractionContextType> ContextTypes { get; }Property Value
DefaultMemberPermissions
Gets the default permissions needed for executing this command.
public GuildPermission? DefaultMemberPermissions { get; }Property Value
DefaultPermission
Gets the DefaultPermission of this command.
public bool DefaultPermission { get; }Property Value
Description
Gets the command description that will be displayed on Discord.
public string Description { get; }Property Value
FlattenedParameters
Gets the flattened collection of command parameters and complex parameter fields.
public IReadOnlyList<SlashCommandParameterInfo> FlattenedParameters { get; }Property Value
IntegrationTypes
Gets the install methods for this command.
public IReadOnlyCollection<ApplicationIntegrationType> IntegrationTypes { get; }Property Value
IsEnabledInDm
Gets whether this command can be used in DMs.
public bool IsEnabledInDm { get; }Property Value
IsNsfw
Gets whether this command can is age restricted.
public bool IsNsfw { get; }Property Value
Parameters
Gets a collection of the parameters of this command.
public override IReadOnlyList<SlashCommandParameterInfo> Parameters { get; }Property Value
SupportsWildCards
Gets whether this command supports wild card patterns.
public override bool SupportsWildCards { get; }Property Value
Methods
ExecuteAsync(IInteractionContext, IServiceProvider)
Executes the command with the provided context.
public override Task<IResult> ExecuteAsync(IInteractionContext context, IServiceProvider services)Parameters
- contextIInteractionContext
- The execution context. 
- servicesIServiceProvider
- Dependencies that will be used to create the module instance. 
Returns
- Task<IResult>
- A task representing the execution process. The task result contains the execution result. 
GetLogString(IInteractionContext)
protected override string GetLogString(IInteractionContext context)Parameters
- contextIInteractionContext
Returns
InvokeModuleEvent(IInteractionContext, IResult)
protected override Task InvokeModuleEvent(IInteractionContext context, IResult result)Parameters
- contextIInteractionContext
- resultIResult
Returns
ParseArgumentsAsync(IInteractionContext, IServiceProvider)
protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services)Parameters
- contextIInteractionContext
- servicesIServiceProvider