Table of Contents

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

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 UserCommandBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

UserCommandBuilder

AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public UserCommandBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

UserCommandBuilder

WithContexts(IEnumerable<InteractionContextType>?)

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

public UserCommandBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

UserCommandBuilder

WithDefaultGuildPermissions(Permissions?)

Default required permissions to use the command.

public UserCommandBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)

Parameters

defaultGuildPermissions Permissions?

Returns

UserCommandBuilder

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public UserCommandBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

UserCommandBuilder

WithNsfw(bool)

Indicates whether the command is age-restricted.

public UserCommandBuilder WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

UserCommandBuilder

WithRegister(bool)

Whether the application command should be registered by the service.

public UserCommandBuilder WithRegister(bool register = true)

Parameters

register bool

Returns

UserCommandBuilder