Table of Contents

Interface IApplicationCommand

Namespace
Discord
Assembly
Discord.Net.Core.dll

The base command model that belongs to an application.

public interface IApplicationCommand : ISnowflakeEntity, IEntity<ulong>, IDeletable
Inherited Members

Properties

ApplicationId

Gets the unique id of the parent application.

ulong ApplicationId { get; }

Property Value

ulong

ContextTypes

Gets context types the command can be used in; null if not specified.

IReadOnlyCollection<InteractionContextType> ContextTypes { get; }

Property Value

IReadOnlyCollection<InteractionContextType>

DefaultMemberPermissions

Set of default GuildPermission required to invoke the command.

GuildPermissions DefaultMemberPermissions { get; }

Property Value

GuildPermissions

Description

Gets the description of the command.

string Description { get; }

Property Value

string

DescriptionLocalizations

Gets the localization dictionary for the description field of this command.

IReadOnlyDictionary<string, string> DescriptionLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

DescriptionLocalized

Gets the localized description of this command.

string DescriptionLocalized { get; }

Property Value

string

Remarks

Only returned when the withLocalizations query parameter is set to false when requesting the command.

IntegrationTypes

Gets the install method for the command; null if not specified.

IReadOnlyCollection<ApplicationIntegrationType> IntegrationTypes { get; }

Property Value

IReadOnlyCollection<ApplicationIntegrationType>

IsDefaultPermission

Gets whether the command is enabled by default when the app is added to a guild.

bool IsDefaultPermission { get; }

Property Value

bool

IsEnabledInDm

Indicates whether the command is available in DMs with the app.

[Obsolete("This property will be deprecated soon. Use ContextTypes instead.")]
bool IsEnabledInDm { get; }

Property Value

bool

Remarks

Only for globally-scoped commands.

IsNsfw

Indicates whether the command is age restricted.

bool IsNsfw { get; }

Property Value

bool

Name

Gets the name of the command.

string Name { get; }

Property Value

string

NameLocalizations

Gets the localization dictionary for the name field of this command.

IReadOnlyDictionary<string, string> NameLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

NameLocalized

Gets the localized name of this command.

string NameLocalized { get; }

Property Value

string

Remarks

Only returned when the withLocalizations query parameter is set to false when requesting the command.

Options

Gets a collection of options for this application command.

IReadOnlyCollection<IApplicationCommandOption> Options { get; }

Property Value

IReadOnlyCollection<IApplicationCommandOption>

Type

Gets the type of the command.

ApplicationCommandType Type { get; }

Property Value

ApplicationCommandType

Methods

ModifyAsync(Action<ApplicationCommandProperties>, RequestOptions)

Modifies the current application command.

Task ModifyAsync(Action<ApplicationCommandProperties> func, RequestOptions options = null)

Parameters

func Action<ApplicationCommandProperties>

The new properties to use when modifying the command.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

ModifyAsync<TArg>(Action<TArg>, RequestOptions)

Modifies the current application command.

Task ModifyAsync<TArg>(Action<TArg> func, RequestOptions options = null) where TArg : ApplicationCommandProperties

Parameters

func Action<TArg>

The new properties to use when modifying the command.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

Type Parameters

TArg

Exceptions

InvalidOperationException

Thrown when you pass in an invalid ApplicationCommandProperties type.