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​
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​
Declaration
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​
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​
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