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