Table of Contents

Constructor DiscordApplicationCommand

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

DiscordApplicationCommand(string, string, IEnumerable<DiscordApplicationCommandOption>, bool?, DiscordApplicationCommandType, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, string>, bool?, DiscordPermissions?, bool?, IReadOnlyList<DiscordInteractionContextType>?, IReadOnlyList<DiscordApplicationIntegrationType>?)

Creates a new instance of a DiscordApplicationCommand.

public DiscordApplicationCommand(string name, string description, IEnumerable<DiscordApplicationCommandOption> options = null, bool? defaultPermission = null, DiscordApplicationCommandType type = DiscordApplicationCommandType.SlashCommand, IReadOnlyDictionary<string, string> name_localizations = null, IReadOnlyDictionary<string, string> description_localizations = null, bool? allowDMUsage = null, DiscordPermissions? defaultMemberPermissions = null, bool? nsfw = null, IReadOnlyList<DiscordInteractionContextType>? contexts = null, IReadOnlyList<DiscordApplicationIntegrationType>? integrationTypes = null)

Parameters

name string

The name of the command.

description string

The description of the command.

options IEnumerable<DiscordApplicationCommandOption>

Optional parameters for this command.

defaultPermission bool?

Whether the command is enabled by default when the application is added to a guild.

type DiscordApplicationCommandType

The type of the application command

name_localizations IReadOnlyDictionary<string, string>

Localization dictionary for name field. Values follow the same restrictions as name.

description_localizations IReadOnlyDictionary<string, string>

Localization dictionary for description field. Values follow the same restrictions as description.

allowDMUsage bool?

Whether this command can be invoked in DMs.

defaultMemberPermissions DiscordPermissions?

What permissions this command requires to be invoked.

nsfw bool?

Whether the command is age restricted.

contexts IReadOnlyList<DiscordInteractionContextType>

The contexts in which the command is allowed to be run in.

integrationTypes IReadOnlyList<DiscordApplicationIntegrationType>

The installation contexts the command can be installed to.