Table of Contents

Class ApplicationCommandProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll
[JsonConverter(typeof(ApplicationCommandProperties.ApplicationCommandPropertiesConverter))]
public abstract class ApplicationCommandProperties
Inheritance
ApplicationCommandProperties
Derived
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?

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).

[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.WhenWritingDefault)]
[JsonPropertyName("nsfw")]
public bool Nsfw { get; set; }

Property Value

bool

Type

Type of the command.

[JsonPropertyName("type")]
public ApplicationCommandType Type { get; }

Property Value

ApplicationCommandType

Methods

AddContexts(params InteractionContextType[])

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

public ApplicationCommandProperties AddContexts(params InteractionContextType[] contexts)

Parameters

contexts InteractionContextType[]

Returns

ApplicationCommandProperties

AddContexts(IEnumerable<InteractionContextType>)

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

public ApplicationCommandProperties AddContexts(IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

ApplicationCommandProperties

AddIntegrationTypes(params ApplicationIntegrationType[])

Installation context(s) where the command is available.

public ApplicationCommandProperties AddIntegrationTypes(params ApplicationIntegrationType[] integrationTypes)

Parameters

integrationTypes ApplicationIntegrationType[]

Returns

ApplicationCommandProperties

AddIntegrationTypes(IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public ApplicationCommandProperties AddIntegrationTypes(IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

ApplicationCommandProperties

WithContexts(IEnumerable<InteractionContextType>?)

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

public ApplicationCommandProperties WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

ApplicationCommandProperties

WithDMPermission(bool?)

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

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

Parameters

dMPermission bool?

Returns

ApplicationCommandProperties

WithDefaultGuildUserPermissions(Permissions?)

Default required permissions to use the command.

public ApplicationCommandProperties WithDefaultGuildUserPermissions(Permissions? defaultGuildUserPermissions)

Parameters

defaultGuildUserPermissions Permissions?

Returns

ApplicationCommandProperties

WithDefaultPermission(bool?)

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

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

Parameters

defaultPermission bool?

Returns

ApplicationCommandProperties

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public ApplicationCommandProperties WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

ApplicationCommandProperties

WithName(string)

Name of the command (1-32 characters).

public ApplicationCommandProperties WithName(string name)

Parameters

name string

Returns

ApplicationCommandProperties

WithNameLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Name (1-32 characters each).

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

Parameters

nameLocalizations IReadOnlyDictionary<string, string>

Returns

ApplicationCommandProperties

WithNsfw(bool)

Indicates whether the command is age-restricted.

public ApplicationCommandProperties WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

ApplicationCommandProperties