Table of Contents

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

ApplicationCommandType

ContextTypes

Gets the context types this command can be executed in.

public IReadOnlyCollection<InteractionContextType> ContextTypes { get; }

Property Value

IReadOnlyCollection<InteractionContextType>

DefaultMemberPermissions

Gets the default permissions needed for executing this command.

public GuildPermission? DefaultMemberPermissions { get; }

Property Value

GuildPermission?

DefaultPermission

Gets the DefaultPermission of this command.

public bool DefaultPermission { get; }

Property Value

bool

Description

Gets the command description that will be displayed on Discord.

public string Description { get; }

Property Value

string

FlattenedParameters

Gets the flattened collection of command parameters and complex parameter fields.

public IReadOnlyList<SlashCommandParameterInfo> FlattenedParameters { get; }

Property Value

IReadOnlyList<SlashCommandParameterInfo>

IntegrationTypes

Gets the install methods for this command.

public IReadOnlyCollection<ApplicationIntegrationType> IntegrationTypes { get; }

Property Value

IReadOnlyCollection<ApplicationIntegrationType>

IsEnabledInDm

Gets whether this command can be used in DMs.

public bool IsEnabledInDm { get; }

Property Value

bool

IsNsfw

Gets whether this command can is age restricted.

public bool IsNsfw { get; }

Property Value

bool

Parameters

Gets a collection of the parameters of this command.

public override IReadOnlyList<SlashCommandParameterInfo> Parameters { get; }

Property Value

IReadOnlyList<SlashCommandParameterInfo>

SupportsWildCards

Gets whether this command supports wild card patterns.

public override bool SupportsWildCards { get; }

Property Value

bool

Methods

ExecuteAsync(IInteractionContext, IServiceProvider)

Executes the command with the provided context.

public override Task<IResult> ExecuteAsync(IInteractionContext context, IServiceProvider services)

Parameters

context IInteractionContext

The execution context.

services IServiceProvider

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

context IInteractionContext

Returns

string

InvokeModuleEvent(IInteractionContext, IResult)

protected override Task InvokeModuleEvent(IInteractionContext context, IResult result)

Parameters

context IInteractionContext
result IResult

Returns

Task

ParseArgumentsAsync(IInteractionContext, IServiceProvider)

protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services)

Parameters

context IInteractionContext
services IServiceProvider

Returns

Task<IResult>