Class RestGuildCommand
Represents a Rest-based guild application command.
Assembly: Discord.Net.Rest.dll​
View Source​
public class RestGuildCommand : RestApplicationCommand, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties​
GuildId​
The guild Id where this command originates.
View Source​
public ulong GuildId { get; }
Methods​
DeleteAsync(RequestOptions)​
Deletes this object and all its children.
View Source​
public override async 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<TArg>(Action<TArg>, RequestOptions)​
Modifies this Discord.Rest.RestApplicationCommand.
View Source​
public override async Task ModifyAsync<TArg>(Action<TArg> func, RequestOptions options = null)
where TArg : ApplicationCommandProperties
Returns​
System.Threading.Tasks.Task
:
The modified command
Parameters​
Type | Name | Description |
---|---|---|
System.Action<<TArg>> | func | The delegate containing the properties to modify the command with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Type Parameters​
TArg
GetCommandPermission(RequestOptions)​
Gets this commands permissions inside of the current guild.
View Source​
public Task<GuildApplicationCommandPermission> GetCommandPermission(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.GuildApplicationCommandPermission>
:
A task that represents the asynchronous get operation. The task result contains a
Discord.GuildApplicationCommandPermission object defining the permissions of the current slash command.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyCommandPermissions(ApplicationCommandPermission[], RequestOptions)​
Modifies the current command permissions for this guild command.
View Source​
public Task<GuildApplicationCommandPermission> ModifyCommandPermissions(ApplicationCommandPermission[] permissions, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.GuildApplicationCommandPermission>
:
A task that represents the asynchronous modification operation. The task result contains a
Discord.GuildApplicationCommandPermission object containing the modified permissions.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ApplicationCommandPermission[] | permissions | The permissions to overwrite. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetGuild(Boolean, RequestOptions)​
Gets the guild that this slash command resides in.
View Source​
public Task<RestGuild> GetGuild(bool withCounts = false, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuild>
:
A task that represents the asynchronous get operation. The task result contains a
Discord.Rest.RestGuild.
Parameters​
Type | Name | Description |
---|---|---|
System.Boolean | withCounts | true if you want the approximate member and presence counts for the guild, otherwise false . |
Discord.RequestOptions | options | The options to be used when sending the request. |