Class EntryPointCommandProperties
Entry point command serves as the primary way for users to open an app's Activity from the App Launcher. You can create only a single Entry Point command per app.
public class EntryPointCommandProperties : ApplicationCommandProperties, IJsonSerializable<ApplicationCommandProperties>
- Inheritance
-
EntryPointCommandProperties
- Implements
- Inherited Members
Constructors
EntryPointCommandProperties(string, string, EntryPointCommandHandler)
Entry point command serves as the primary way for users to open an app's Activity from the App Launcher. You can create only a single Entry Point command per app.
public EntryPointCommandProperties(string name, string description, EntryPointCommandHandler handler)
Parameters
name
stringName of the command (1-32 characters). description
stringDescription of the command (1-100 characters). handler
EntryPointCommandHandlerDetermines whether the interaction is handled by the app's interactions handler or by Discord.
Properties
Description
Description of the command (1-100 characters).
[JsonPropertyName("description")]
public string Description { get; set; }
Property Value
DescriptionLocalizations
Localizations of Description (1-100 characters each).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description_localizations")]
public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; set; }
Property Value
Handler
Determines whether the interaction is handled by the app's interactions handler or by Discord.
[JsonPropertyName("handler")]
public EntryPointCommandHandler Handler { get; set; }
Property Value
Methods
AddContexts(params IEnumerable<InteractionContextType>)
Interaction context(s) where the command can be used.
public EntryPointCommandProperties AddContexts(params IEnumerable<InteractionContextType> contexts)
Parameters
contexts
IEnumerable<InteractionContextType>
Returns
AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)
Installation context(s) where the command is available.
public EntryPointCommandProperties AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)
Parameters
integrationTypes
IEnumerable<ApplicationIntegrationType>
Returns
WithContexts(IEnumerable<InteractionContextType>?)
Interaction context(s) where the command can be used.
public EntryPointCommandProperties WithContexts(IEnumerable<InteractionContextType>? contexts)
Parameters
contexts
IEnumerable<InteractionContextType>
Returns
WithDefaultGuildPermissions(Permissions?)
Default required permissions to use the command.
public EntryPointCommandProperties WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)
Parameters
defaultGuildPermissions
Permissions?
Returns
WithDescription(string)
Description of the command (1-100 characters).
public EntryPointCommandProperties WithDescription(string description)
Parameters
description
string
Returns
WithDescriptionLocalizations(IReadOnlyDictionary<string, string>?)
Localizations of Description (1-100 characters each).
public EntryPointCommandProperties WithDescriptionLocalizations(IReadOnlyDictionary<string, string>? descriptionLocalizations)
Parameters
descriptionLocalizations
IReadOnlyDictionary<string, string>
Returns
WithHandler(EntryPointCommandHandler)
Determines whether the interaction is handled by the app's interactions handler or by Discord.
public EntryPointCommandProperties WithHandler(EntryPointCommandHandler handler)
Parameters
handler
EntryPointCommandHandler
Returns
WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)
Installation context(s) where the command is available.
public EntryPointCommandProperties WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)
Parameters
integrationTypes
IEnumerable<ApplicationIntegrationType>
Returns
WithName(string)
Name of the command (1-32 characters).
public EntryPointCommandProperties WithName(string name)
Parameters
name
string
Returns
WithNameLocalizations(IReadOnlyDictionary<string, string>?)
Localizations of Name (1-32 characters each).
public EntryPointCommandProperties WithNameLocalizations(IReadOnlyDictionary<string, string>? nameLocalizations)
Parameters
nameLocalizations
IReadOnlyDictionary<string, string>
Returns
WithNsfw(bool)
Indicates whether the command is age-restricted.
public EntryPointCommandProperties WithNsfw(bool nsfw = true)
Parameters
nsfw
bool