Table of Contents

Class SlashCommandGroupBuilder

Namespace
NetCord.Services.ApplicationCommands
Assembly
NetCord.Services.dll

Slash commands are application commands that are invoked by typing a slash (/) in the chat input box. They allow users to interact with your application.

public class SlashCommandGroupBuilder : ApplicationCommandBuilder
Inheritance
SlashCommandGroupBuilder
Inherited Members

Constructors

SlashCommandGroupBuilder(string, string)

Slash commands are application commands that are invoked by typing a slash (/) in the chat input box. They allow users to interact with your application.

public SlashCommandGroupBuilder(string name, string description)

Parameters

name string
Name of the command (1-32 characters). Must be lowercase.
description string
Description of the command (1-100 characters).

Properties

Description

Description of the command (1-100 characters).

public string Description { get; }

Property Value

string

Methods

AddContexts(params IEnumerable<InteractionContextType>)

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

public SlashCommandGroupBuilder AddContexts(params IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

SlashCommandGroupBuilder

AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public SlashCommandGroupBuilder AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

SlashCommandGroupBuilder

AddSubCommand(string, string, Delegate)

Adds a sub command to a command group.

public SubSlashCommandBuilder AddSubCommand(string name, string description, Delegate handler)

Parameters

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

Returns

SubSlashCommandBuilder

The created sub command builder.

AddSubCommandGroup(string, string)

Adds a sub command group to a command group.

public SubSlashCommandGroupBuilder AddSubCommandGroup(string name, string description)

Parameters

name string
Name of the command (1-32 characters).
description string
Description of the command (1-100 characters).

Returns

SubSlashCommandGroupBuilder

The created sub command group builder.

AddSubCommandGroup(string, string, Action<SubSlashCommandGroupBuilder>)

Adds a sub command group to a command group.

public SubSlashCommandGroupBuilder AddSubCommandGroup(string name, string description, Action<SubSlashCommandGroupBuilder> builder)

Parameters

name string
Name of the command (1-32 characters).
description string
Description of the command (1-100 characters).
builder Action<SubSlashCommandGroupBuilder>

A delegate that builds the sub command group.

Returns

SubSlashCommandGroupBuilder

The created sub command group builder.

WithContexts(IEnumerable<InteractionContextType>?)

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

public SlashCommandGroupBuilder WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

SlashCommandGroupBuilder

WithDefaultGuildPermissions(Permissions?)

Default required permissions to use the command.

public SlashCommandGroupBuilder WithDefaultGuildPermissions(Permissions? defaultGuildPermissions)

Parameters

defaultGuildPermissions Permissions?

Returns

SlashCommandGroupBuilder

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public SlashCommandGroupBuilder WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

SlashCommandGroupBuilder

WithNsfw(bool)

Indicates whether the command is age-restricted.

public SlashCommandGroupBuilder WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

SlashCommandGroupBuilder

WithRegister(bool)

Whether the application command should be registered by the service.

public SlashCommandGroupBuilder WithRegister(bool register = true)

Parameters

register bool

Returns

SlashCommandGroupBuilder