Skip to main content

Class RestApplicationCommand

Represents a Rest-based implementation of the Discord.IApplicationCommand.

Assembly: Discord.Net.Rest.dll​
View Source​
Declaration
public abstract class RestApplicationCommand : RestEntity<ulong>, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

ApplicationId​

Gets the unique id of the parent application.

View Source​
Declaration
public ulong ApplicationId { get; }

Type​

Gets the type of the command.

View Source​
Declaration
public ApplicationCommandType Type { get; }

Name​

Gets the name of the command.

View Source​
Declaration
public string Name { get; }

Description​

Gets the description of the command.

View Source​
Declaration
public string Description { get; }

IsDefaultPermission​

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

View Source​
Declaration
public bool IsDefaultPermission { get; }

Options​

The options of this command.

View Source​
Declaration
public IReadOnlyCollection<RestApplicationCommandOption> Options { get; }

CreatedAt​

Gets when the snowflake was created.

View Source​
Declaration
public DateTimeOffset CreatedAt { get; }

IApplicationCommand.Options​

View Source​
Declaration
IReadOnlyCollection<IApplicationCommandOption> IApplicationCommand.Options { get; }

Methods​

DeleteAsync(RequestOptions)​

Deletes this object and all its children.

View Source​
Declaration
public abstract Task DeleteAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyAsync(Action<ApplicationCommandProperties>, RequestOptions)​

Modifies the current application command.

View Source​
Declaration
public Task ModifyAsync(Action<ApplicationCommandProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.ApplicationCommandProperties>funcThe new properties to use when modifying the command.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Modifies the current application command.

View Source​
Declaration
public abstract Task ModifyAsync<TArg>(Action<TArg> func, RequestOptions options = null)
where TArg : ApplicationCommandProperties
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<<TArg>>funcThe new properties to use when modifying the command.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Type Parameters​
  • TArg

Implements​