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
namestringThe name of the command.
descriptionstringThe description of the command.
optionsIEnumerable<DiscordApplicationCommandOption>Optional parameters for this command.
defaultPermissionbool?Whether the command is enabled by default when the application is added to a guild.
typeDiscordApplicationCommandTypeThe type of the application command
name_localizationsIReadOnlyDictionary<string, string>Localization dictionary for
namefield. Values follow the same restrictions asname.description_localizationsIReadOnlyDictionary<string, string>Localization dictionary for
descriptionfield. Values follow the same restrictions asdescription.allowDMUsagebool?Whether this command can be invoked in DMs.
defaultMemberPermissionsDiscordPermissions?What permissions this command requires to be invoked.
nsfwbool?Whether the command is age restricted.
contextsIReadOnlyList<DiscordInteractionContextType>The contexts in which the command is allowed to be run in.
integrationTypesIReadOnlyList<DiscordApplicationIntegrationType>The installation contexts the command can be installed to.