DiscordPHP-BridgeBot Documentation

Slash
in package

FinalYes

How an {@see Action} presents itself as a Discord slash command.

Slash commands need something prefix commands do not: a declared, typed parameter list, so Discord can render a picker and reject bad input before the bot ever sees it. Rather than describe every action twice, an action opts in by attaching one of these, and SlashAdapter turns it into the real thing — reusing the same handler, unchanged.

There is no sub-command list here, and deliberately so: an action is a leaf. Where it sits in the tree is its qualifier and group, and a command with children is something SlashAdapter assembles out of several actions rather than something one action declares.

Actions without a spec are still reachable by prefix in every chat; they simply do not appear in Discord's command menu.

Tags
author

Valithor Obsidion valithor@discordphp.org

Table of Contents

Properties

$ephemeral  : bool
$options  : array<string|int, mixed>

Methods

__construct()  : mixed

Properties

$ephemeral read-only

public bool $ephemeral = false

$options read-only

public array<string|int, mixed> $options = []

Methods

__construct()

public __construct([array<int, SlashOption> $options = [] ][, bool $ephemeral = false ]) : mixed
Parameters
$options : array<int, SlashOption> = []

This command's typed parameters.

$ephemeral : bool = false

Whether the reply is shown only to the invoker.

On this page

Search results