Table of Contents

Class RestGuildCommand

Namespace
Discord.Rest
Assembly
Discord.Net.Rest.dll

Represents a Rest-based guild application command.

public class RestGuildCommand : RestApplicationCommand, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable
Inheritance
RestGuildCommand
Implements
Inherited Members

Properties

GuildId

Gets the guild Id where this command originates.

public ulong GuildId { get; }

Property Value

ulong

Methods

DeleteAsync(RequestOptions)

Deletes this object and all its children.

public override Task DeleteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

GetCommandPermission(RequestOptions)

Gets this commands permissions inside of the current guild.

public Task<GuildApplicationCommandPermission> GetCommandPermission(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<GuildApplicationCommandPermission>

A task that represents the asynchronous get operation. The task result contains a GuildApplicationCommandPermission object defining the permissions of the current slash command.

GetGuild(bool, RequestOptions)

Gets the guild that this slash command resides in.

public Task<RestGuild> GetGuild(bool withCounts = false, RequestOptions options = null)

Parameters

withCounts bool

true if you want the approximate member and presence counts for the guild, otherwise false.

options RequestOptions

The options to be used when sending the request.

Returns

Task<RestGuild>

A task that represents the asynchronous get operation. The task result contains a RestGuild.

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

Modifies this RestApplicationCommand.

public override Task ModifyAsync<TArg>(Action<TArg> func, RequestOptions options = null) where TArg : ApplicationCommandProperties

Parameters

func Action<TArg>

The delegate containing the properties to modify the command with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

The modified command

Type Parameters

TArg

ModifyCommandPermissions(ApplicationCommandPermission[], RequestOptions)

Modifies the current command permissions for this guild command.

public Task<GuildApplicationCommandPermission> ModifyCommandPermissions(ApplicationCommandPermission[] permissions, RequestOptions options = null)

Parameters

permissions ApplicationCommandPermission[]

The permissions to overwrite.

options RequestOptions

The options to be used when sending the request.

Returns

Task<GuildApplicationCommandPermission>

A task that represents the asynchronous modification operation. The task result contains a GuildApplicationCommandPermission object containing the modified permissions.