Table of Contents

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

name string
Name of the command (1-32 characters).
handler Delegate
Handler that represents the body of the command.

Properties

Handler

Handler that represents the body of the command.

public Delegate Handler { get; }

Property Value

Delegate

Methods

AddContexts(params IEnumerable<InteractionContextType>)

Interaction context(s) where the command can be used.

public MessageCommandBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

MessageCommandBuilder

AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public MessageCommandBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

MessageCommandBuilder

WithContexts(IEnumerable<InteractionContextType>?)

Interaction context(s) where the command can be used.

public MessageCommandBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

MessageCommandBuilder

WithDefaultGuildPermissions(Permissions?)

Default required permissions to use the command.

public MessageCommandBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)

Parameters

defaultGuildPermissions Permissions?

Returns

MessageCommandBuilder

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public MessageCommandBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

MessageCommandBuilder

WithNsfw(bool)

Indicates whether the command is age-restricted.

public MessageCommandBuilder WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

MessageCommandBuilder

WithRegister(bool)

Whether the application command should be registered by the service.

public MessageCommandBuilder WithRegister(bool register = true)

Parameters

register bool

Returns

MessageCommandBuilder