Class SocketApplicationCommand
Represents a Websocket-based Discord.IApplicationCommand.
Assembly: Discord.Net.WebSocket.dll​
View Source​
public class SocketApplicationCommand : SocketEntity<ulong>, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties​
IsGlobalCommand​
true
if this command is a global command, otherwise false
.
View Source​
public bool IsGlobalCommand { get; }
ApplicationId​
Gets the unique id of the parent application.
View Source​
public ulong ApplicationId { get; }
Name​
Gets the name of the command.
View Source​
public string Name { get; }
Type​
Gets the type of the command.
View Source​
public ApplicationCommandType Type { get; }
Description​
Gets the description of the command.
View Source​
public string Description { get; }
IsDefaultPermission​
Gets whether the command is enabled by default when the app is added to a guild.
View Source​
public bool IsDefaultPermission { get; }
Options​
A collection of Discord.WebSocket.SocketApplicationCommandOption's for this command.
View Source​
public IReadOnlyCollection<SocketApplicationCommandOption> Options { get; }
CreatedAt​
Gets when the snowflake was created.
View Source​
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​
public SocketGuild Guild { get; }
IApplicationCommand.Options​
View Source​
IReadOnlyCollection<IApplicationCommandOption> IApplicationCommand.Options { get; }
Methods​
DeleteAsync(RequestOptions)​
Deletes this object and all its children.
View Source​
public Task DeleteAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync(Action<ApplicationCommandProperties>, RequestOptions)​
Modifies the current application command.
View Source​
public Task ModifyAsync(Action<ApplicationCommandProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.ApplicationCommandProperties> | func | The new properties to use when modifying the command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync<TArg>(Action<TArg>, RequestOptions)​
Modifies the current application command.
View Source​
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​
Type | Name | Description |
---|---|---|
System.Action<<TArg>> | func | The new properties to use when modifying the command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Type Parameters​
TArg