Class EntryPointCommandBuilder
- Namespace
- NetCord.Services.ApplicationCommands
- Assembly
- NetCord.Services.dll
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 EntryPointCommandBuilder : ApplicationCommandBuilder
- Inheritance
-
EntryPointCommandBuilder
- Inherited Members
Constructors
EntryPointCommandBuilder(string, string)
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 EntryPointCommandBuilder(string name, string description)
Parameters
namestringName of the command (1-32 characters). descriptionstringDescription of the command (1-100 characters).
Properties
Description
Description of the command (1-100 characters).
public string Description { get; }
Property Value
Handler
Handler that represents the body of the command.
public Delegate? Handler { get; set; }
Property Value
Methods
AddContexts(params IEnumerable<InteractionContextType>)
Interaction context(s) where the command can be used.
public EntryPointCommandBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)
Installation context(s) where the command is available.
public EntryPointCommandBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithContexts(IEnumerable<InteractionContextType>?)
Interaction context(s) where the command can be used.
public EntryPointCommandBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
WithDefaultGuildPermissions(Permissions?)
Default required permissions to use the command.
public EntryPointCommandBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)
Parameters
defaultGuildPermissionsPermissions?
Returns
WithHandler(Delegate?)
Handler that represents the body of the command.
public EntryPointCommandBuilder WithHandler(Delegate? handler)
Parameters
handlerDelegate
Returns
WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)
Installation context(s) where the command is available.
public EntryPointCommandBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithNsfw(bool)
Indicates whether the command is age-restricted.
public EntryPointCommandBuilder WithNsfw(bool nsfw = true)
Parameters
nsfwbool
Returns
WithRegister(bool)
Whether the application command should be registered by the service.
public EntryPointCommandBuilder WithRegister(bool register = true)
Parameters
registerbool