Skip to main content

Class SocketApplicationCommand

Represents a Websocket-based Discord.IApplicationCommand.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class SocketApplicationCommand : SocketEntity<ulong>, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

IsGlobalCommand​

true if this command is a global command, otherwise false.

View Source​
Declaration
public bool IsGlobalCommand { get; }

ApplicationId​

Gets the unique id of the parent application.

View Source​
Declaration
public ulong ApplicationId { get; }

Name​

Gets the name of the command.

View Source​
Declaration
public string Name { get; }

Type​

Gets the type of the command.

View Source​
Declaration
public ApplicationCommandType Type { 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​

A collection of Discord.WebSocket.SocketApplicationCommandOption's for this command.

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

CreatedAt​

Gets when the snowflake was created.

View Source​
Declaration
public DateTimeOffset CreatedAt { get; }

Guild​

Returns the guild this command resides in, if this command is a global command then it will return null

View Source​
Declaration
public SocketGuild Guild { 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 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 async 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​