Class MessageCommandBuilder
- Namespace
- NetCord.Services.ApplicationCommands
- Assembly
- NetCord.Services.dll
Message commands are application commands that appear on the context menu (right click or tap) of messages. They are a great way to surface quick actions for your app that target messages.
public class MessageCommandBuilder : ApplicationCommandBuilder
- Inheritance
-
MessageCommandBuilder
- Inherited Members
Constructors
MessageCommandBuilder(string, Delegate)
Message commands are application commands that appear on the context menu (right click or tap) of messages. They are a great way to surface quick actions for your app that target messages.
public MessageCommandBuilder(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 MessageCommandBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)
Installation context(s) where the command is available.
public MessageCommandBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithContexts(IEnumerable<InteractionContextType>?)
Interaction context(s) where the command can be used.
public MessageCommandBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)
Parameters
contextsIEnumerable<InteractionContextType>
Returns
WithDefaultGuildPermissions(Permissions?)
Default required permissions to use the command.
public MessageCommandBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)
Parameters
defaultGuildPermissionsPermissions?
Returns
WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)
Installation context(s) where the command is available.
public MessageCommandBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)
Parameters
integrationTypesIEnumerable<ApplicationIntegrationType>
Returns
WithNsfw(bool)
Indicates whether the command is age-restricted.
public MessageCommandBuilder WithNsfw(bool nsfw = true)
Parameters
nsfwbool
Returns
WithRegister(bool)
Whether the application command should be registered by the service.
public MessageCommandBuilder WithRegister(bool register = true)
Parameters
registerbool