Table of Contents

Class ApplicationCommandOptions

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class ApplicationCommandOptions
Inheritance
ApplicationCommandOptions
Inherited Members

Properties

Contexts

Interaction context(s) where the command can be used.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contexts")]
public IEnumerable<InteractionContextType>? Contexts { get; set; }

Property Value

IEnumerable<InteractionContextType>

DMPermission

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

[Obsolete("Replaced by 'Contexts'.")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("dm_permission")]
public bool? DMPermission { get; set; }

Property Value

bool?

DefaultGuildUserPermissions

Default required permissions to use the command.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("default_member_permissions")]
public Permissions? DefaultGuildUserPermissions { get; set; }

Property Value

Permissions?

DefaultPermission

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

[Obsolete("Replaced by 'DefaultGuildUserPermissions'.")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("default_permission")]
public bool? DefaultPermission { get; set; }

Property Value

bool?

Description

Description of the command (1-100 characters).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

DescriptionLocalizations

Localizations of Description (1-100 characters each).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description_localizations")]
public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; set; }

Property Value

IReadOnlyDictionary<string, string>

IntegrationTypes

Installation context(s) where the command is available.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("integration_types")]
public IEnumerable<ApplicationIntegrationType>? IntegrationTypes { get; set; }

Property Value

IEnumerable<ApplicationIntegrationType>

Name

Name of the command (1-32 characters).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("name")]
public string? Name { get; set; }

Property Value

string

NameLocalizations

Localizations of Name (1-32 characters each).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("name_localizations")]
public IReadOnlyDictionary<string, string>? NameLocalizations { get; set; }

Property Value

IReadOnlyDictionary<string, string>

Nsfw

Indicates whether the command is age-restricted.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("nsfw")]
public bool? Nsfw { get; set; }

Property Value

bool?

Options

Parameters for the command (max 25).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("options")]
public IEnumerable<ApplicationCommandOptionProperties>? Options { get; set; }

Property Value

IEnumerable<ApplicationCommandOptionProperties>

Methods

AddContexts(params InteractionContextType[])

Interaction context(s) where the command can be used.

public ApplicationCommandOptions AddContexts(params InteractionContextType[] contexts)

Parameters

contexts InteractionContextType[]

Returns

ApplicationCommandOptions

AddContexts(IEnumerable<InteractionContextType>)

Interaction context(s) where the command can be used.

public ApplicationCommandOptions AddContexts(IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

ApplicationCommandOptions

AddIntegrationTypes(params ApplicationIntegrationType[])

Installation context(s) where the command is available.

public ApplicationCommandOptions AddIntegrationTypes(params ApplicationIntegrationType[] integrationTypes)

Parameters

integrationTypes ApplicationIntegrationType[]

Returns

ApplicationCommandOptions

AddIntegrationTypes(IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public ApplicationCommandOptions AddIntegrationTypes(IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

ApplicationCommandOptions

AddOptions(params ApplicationCommandOptionProperties[])

Parameters for the command (max 25).

public ApplicationCommandOptions AddOptions(params ApplicationCommandOptionProperties[] options)

Parameters

options ApplicationCommandOptionProperties[]

Returns

ApplicationCommandOptions

AddOptions(IEnumerable<ApplicationCommandOptionProperties>)

Parameters for the command (max 25).

public ApplicationCommandOptions AddOptions(IEnumerable<ApplicationCommandOptionProperties> options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

ApplicationCommandOptions

WithContexts(IEnumerable<InteractionContextType>?)

Interaction context(s) where the command can be used.

public ApplicationCommandOptions WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

ApplicationCommandOptions

WithDMPermission(bool?)

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

[Obsolete("Replaced by 'Contexts'.")]
public ApplicationCommandOptions WithDMPermission(bool? dMPermission = true)

Parameters

dMPermission bool?

Returns

ApplicationCommandOptions

WithDefaultGuildUserPermissions(Permissions?)

Default required permissions to use the command.

public ApplicationCommandOptions WithDefaultGuildUserPermissions(Permissions? defaultGuildUserPermissions)

Parameters

defaultGuildUserPermissions Permissions?

Returns

ApplicationCommandOptions

WithDefaultPermission(bool?)

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

[Obsolete("Replaced by 'DefaultGuildUserPermissions'.")]
public ApplicationCommandOptions WithDefaultPermission(bool? defaultPermission = true)

Parameters

defaultPermission bool?

Returns

ApplicationCommandOptions

WithDescription(string?)

Description of the command (1-100 characters).

public ApplicationCommandOptions WithDescription(string? description)

Parameters

description string

Returns

ApplicationCommandOptions

WithDescriptionLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Description (1-100 characters each).

public ApplicationCommandOptions WithDescriptionLocalizations(IReadOnlyDictionary<string, string>? descriptionLocalizations)

Parameters

descriptionLocalizations IReadOnlyDictionary<string, string>

Returns

ApplicationCommandOptions

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public ApplicationCommandOptions WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

ApplicationCommandOptions

WithName(string?)

Name of the command (1-32 characters).

public ApplicationCommandOptions WithName(string? name)

Parameters

name string

Returns

ApplicationCommandOptions

WithNameLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Name (1-32 characters each).

public ApplicationCommandOptions WithNameLocalizations(IReadOnlyDictionary<string, string>? nameLocalizations)

Parameters

nameLocalizations IReadOnlyDictionary<string, string>

Returns

ApplicationCommandOptions

WithNsfw(bool?)

Indicates whether the command is age-restricted.

public ApplicationCommandOptions WithNsfw(bool? nsfw = true)

Parameters

nsfw bool?

Returns

ApplicationCommandOptions

WithOptions(IEnumerable<ApplicationCommandOptionProperties>?)

Parameters for the command (max 25).

public ApplicationCommandOptions WithOptions(IEnumerable<ApplicationCommandOptionProperties>? options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

ApplicationCommandOptions