Table of Contents

Class ApplicationCommand

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class ApplicationCommand : ClientEntity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonApplicationCommand>
Inheritance
ApplicationCommand
Implements
Derived
Inherited Members

Constructors

ApplicationCommand(JsonApplicationCommand, RestClient)

public ApplicationCommand(JsonApplicationCommand jsonModel, RestClient client)

Parameters

jsonModel JsonApplicationCommand
client RestClient

Properties

ApplicationId

ID of the parent application.

public ulong ApplicationId { get; }

Property Value

ulong

Contexts

Interaction context(s) where the command can be used, only for globally-scoped commands.

public IReadOnlyList<InteractionContextType>? Contexts { get; }

Property Value

IReadOnlyList<InteractionContextType>

DMPermission

Indicates whether the command is available in DMs with the app.

[Obsolete("Replaced by 'Contexts'.")]
public bool DMPermission { get; }

Property Value

bool

DefaultGuildUserPermissions

Default required permissions to use the command.

public Permissions? DefaultGuildUserPermissions { get; }

Property Value

Permissions?

DefaultPermission

Indicates whether the command is enabled by default when the app is added to a guild.

[Obsolete("Replaced by 'DefaultGuildUserPermissions'.")]
public bool DefaultPermission { get; }

Property Value

bool

Description

Description of the command (1-100 characters).

public string Description { get; }

Property Value

string

DescriptionLocalizations

Localizations of Description (1-100 characters each).

public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

Id

The unique identifier for this object.

public override ulong Id { get; }

Property Value

ulong

IntegrationTypes

Installation context(s) where the command is available, only for globally-scoped commands.

public IReadOnlyList<ApplicationIntegrationType>? IntegrationTypes { get; }

Property Value

IReadOnlyList<ApplicationIntegrationType>

Name

Name of the command (1-32 characters).

public string Name { get; }

Property Value

string

NameLocalizations

Localizations of Name (1-32 characters each).

public IReadOnlyDictionary<string, string>? NameLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

Nsfw

Indicates whether the command is age-restricted.

public bool Nsfw { get; }

Property Value

bool

Options

Parameters for the command (max 25).

public IReadOnlyList<ApplicationCommandOption> Options { get; }

Property Value

IReadOnlyList<ApplicationCommandOption>

Type

Type of the command.

public ApplicationCommandType Type { get; }

Property Value

ApplicationCommandType

Version

Autoincrementing version identifier updated during substantial record changes.

public ulong Version { get; }

Property Value

ulong

Methods

DeleteAsync(RestRequestProperties?, CancellationToken)

public virtual Task DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

GetAsync(RestRequestProperties?, CancellationToken)

public virtual Task<ApplicationCommand> GetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommand>

GetGuildPermissionsAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<ApplicationCommandGuildPermissions> GetGuildPermissionsAsync(ulong guildId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

ModifyAsync(Action<ApplicationCommandOptions>, RestRequestProperties?, CancellationToken)

public virtual Task<ApplicationCommand> ModifyAsync(Action<ApplicationCommandOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<ApplicationCommandOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommand>

OverwriteGuildPermissionsAsync(ulong, IEnumerable<ApplicationCommandGuildPermissionProperties>, RestRequestProperties?, CancellationToken)

public Task<ApplicationCommandGuildPermissions> OverwriteGuildPermissionsAsync(ulong guildId, IEnumerable<ApplicationCommandGuildPermissionProperties> newPermissions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
newPermissions IEnumerable<ApplicationCommandGuildPermissionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

ToString()

public override string ToString()

Returns

string

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

public override bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)

Parameters

destination Span<char>
charsWritten int
format ReadOnlySpan<char>
provider IFormatProvider

Returns

bool