Table of Contents

Class SlashCommandProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class SlashCommandProperties : ApplicationCommandProperties
Inheritance
SlashCommandProperties
Inherited Members

Constructors

SlashCommandProperties(string, string)

public SlashCommandProperties(string name, string description)

Parameters

name string

Name of the command (1-32 characters).

description string

Description of the command (1-100 characters).

Properties

Description

Description of the command (1-100 characters).

[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>

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 SlashCommandProperties AddContexts(params InteractionContextType[] contexts)

Parameters

contexts InteractionContextType[]

Returns

SlashCommandProperties

AddContexts(IEnumerable<InteractionContextType>)

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

public SlashCommandProperties AddContexts(IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

SlashCommandProperties

AddIntegrationTypes(params ApplicationIntegrationType[])

Installation context(s) where the command is available.

public SlashCommandProperties AddIntegrationTypes(params ApplicationIntegrationType[] integrationTypes)

Parameters

integrationTypes ApplicationIntegrationType[]

Returns

SlashCommandProperties

AddIntegrationTypes(IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public SlashCommandProperties AddIntegrationTypes(IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

SlashCommandProperties

AddOptions(params ApplicationCommandOptionProperties[])

Parameters for the command (max 25).

public SlashCommandProperties AddOptions(params ApplicationCommandOptionProperties[] options)

Parameters

options ApplicationCommandOptionProperties[]

Returns

SlashCommandProperties

AddOptions(IEnumerable<ApplicationCommandOptionProperties>)

Parameters for the command (max 25).

public SlashCommandProperties AddOptions(IEnumerable<ApplicationCommandOptionProperties> options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

SlashCommandProperties

WithContexts(IEnumerable<InteractionContextType>?)

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

public SlashCommandProperties WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

SlashCommandProperties

WithDMPermission(bool?)

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

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

Parameters

dMPermission bool?

Returns

SlashCommandProperties

WithDefaultGuildUserPermissions(Permissions?)

Default required permissions to use the command.

public SlashCommandProperties WithDefaultGuildUserPermissions(Permissions? defaultGuildUserPermissions)

Parameters

defaultGuildUserPermissions Permissions?

Returns

SlashCommandProperties

WithDefaultPermission(bool?)

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

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

Parameters

defaultPermission bool?

Returns

SlashCommandProperties

WithDescription(string)

Description of the command (1-100 characters).

public SlashCommandProperties WithDescription(string description)

Parameters

description string

Returns

SlashCommandProperties

WithDescriptionLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Description (1-100 characters each).

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

Parameters

descriptionLocalizations IReadOnlyDictionary<string, string>

Returns

SlashCommandProperties

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public SlashCommandProperties WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

SlashCommandProperties

WithName(string)

Name of the command (1-32 characters).

public SlashCommandProperties WithName(string name)

Parameters

name string

Returns

SlashCommandProperties

WithNameLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Name (1-32 characters each).

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

Parameters

nameLocalizations IReadOnlyDictionary<string, string>

Returns

SlashCommandProperties

WithNsfw(bool)

Indicates whether the command is age-restricted.

public SlashCommandProperties WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

SlashCommandProperties

WithOptions(IEnumerable<ApplicationCommandOptionProperties>?)

Parameters for the command (max 25).

public SlashCommandProperties WithOptions(IEnumerable<ApplicationCommandOptionProperties>? options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

SlashCommandProperties