Table of Contents

Class CommandGroupAttribute

Namespace
Signal.Application.Commands
Assembly
Signal.Application.dll

Puts every command of a CommandModule (or an ICommand class) under a group, so it is invoked as /group command. Preconditions on the module apply to all of its commands.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class CommandGroupAttribute : Attribute
Inheritance
CommandGroupAttribute
Inherited Members

Examples

[CommandGroup("playlist", Aliases = ["pl"], Description = "Manage the playlist"), RequireGroup]
public sealed class PlaylistModule : CommandModule
{
    [Command("add")]    public Task AddAsync([Remainder] string song) => …;   // /playlist add …, /pl add …
    [Command("remove")] public Task RemoveAsync(int index) => …;           // /playlist remove 2
}

Constructors

CommandGroupAttribute(string)

Puts every command of a CommandModule (or an ICommand class) under a group, so it is invoked as /group command. Preconditions on the module apply to all of its commands.

public CommandGroupAttribute(string name)

Parameters

name string

The group name (no whitespace).

Examples

[CommandGroup("playlist", Aliases = ["pl"], Description = "Manage the playlist"), RequireGroup]
public sealed class PlaylistModule : CommandModule
{
    [Command("add")]    public Task AddAsync([Remainder] string song) => …;   // /playlist add …, /pl add …
    [Command("remove")] public Task RemoveAsync(int index) => …;           // /playlist remove 2
}

Properties

Aliases

Alternative group names.

public string[] Aliases { get; set; }

Property Value

string[]

Description

One-line description for help.

public string? Description { get; set; }

Property Value

string

Name

The group name.

public string Name { get; }

Property Value

string