Class UserCommandBuilder
- Namespace
- NetCord.Services.ApplicationCommands
- Assembly
- NetCord.Services.dll
User commands are application commands that appear on the context menu (right click or tap) of users. They are a great way to surface quick actions for your app that target users.
public class UserCommandBuilder : ApplicationCommandBuilder
- Inheritance
-
UserCommandBuilder
- Inherited Members
Constructors
UserCommandBuilder(string, Delegate)
User commands are application commands that appear on the context menu (right click or tap) of users. They are a great way to surface quick actions for your app that target users.
public UserCommandBuilder(string name, Delegate handler)
Parameters
namestringName of the command (1-32 characters). handlerDelegateHandler that represents the body of the command.
Properties
Handler
Handler that represents the body of the command.
public Delegate Handler { get; }
Property Value
Methods
AddContexts(params IEnumerable<InteractionContextType>)
Interaction context(s) where the command can be used.
public UserCommandBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)
Installation context(s) where the command is available.
public UserCommandBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithContexts(IEnumerable<InteractionContextType>?)
Interaction context(s) where the command can be used.
public UserCommandBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
WithDefaultGuildPermissions(Permissions?)
Default required permissions to use the command.
public UserCommandBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)
Parameters
defaultGuildPermissionsPermissions?
Returns
WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)
Installation context(s) where the command is available.
public UserCommandBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithNsfw(bool)
Indicates whether the command is age-restricted.
public UserCommandBuilder WithNsfw(bool nsfw = true)
Parameters
nsfwbool
Returns
WithRegister(bool)
Whether the application command should be registered by the service.
public UserCommandBuilder WithRegister(bool register = true)
Parameters
registerbool