Skip to main content

Class RestGuildCommand

Represents a Rest-based guild application command.

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

Properties​

GuildId​

The guild Id where this command originates.

View Source​
Declaration
public ulong GuildId { get; }

Methods​

DeleteAsync(RequestOptions)​

Deletes this object and all its children.

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

System.Threading.Tasks.Task

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

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

Modifies this Discord.Rest.RestApplicationCommand.

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

System.Threading.Tasks.Task: The modified command

Parameters​
TypeNameDescription
System.Action<<TArg>>funcThe delegate containing the properties to modify the command with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Type Parameters​
  • TArg

GetCommandPermission(RequestOptions)​

Gets this commands permissions inside of the current guild.

View Source​
Declaration
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​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyCommandPermissions(ApplicationCommandPermission[], RequestOptions)​

Modifies the current command permissions for this guild command.

View Source​
Declaration
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​
TypeNameDescription
Discord.ApplicationCommandPermission[]permissionsThe permissions to overwrite.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetGuild(Boolean, RequestOptions)​

Gets the guild that this slash command resides in.

View Source​
Declaration
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​
TypeNameDescription
System.BooleanwithCountstrue if you want the approximate member and presence counts for the guild, otherwise false.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Implements​