DiscordPHP-BridgeBot Documentation

SlashOption
in package

FinalYes

One typed parameter of a slash command.

Tags
author

Valithor Obsidion valithor@discordphp.org

Table of Contents

Constants

ATTACHMENT  : mixed = \Discord\Parts\Interactions\Command\Option::ATT...
BOOLEAN  : mixed = \Discord\Parts\Interactions\Command\Option::BOO...
CHANNEL  : mixed = \Discord\Parts\Interactions\Command\Option::CHA...
INTEGER  : mixed = \Discord\Parts\Interactions\Command\Option::INT...
NUMBER  : mixed = \Discord\Parts\Interactions\Command\Option::NUMBER
ROLE  : mixed = \Discord\Parts\Interactions\Command\Option::ROLE
STRING  : mixed = \Discord\Parts\Interactions\Command\Option::STRING
USER  : mixed = \Discord\Parts\Interactions\Command\Option::USER

Properties

$description  : string
$name  : string
$required  : bool
$type  : int

Methods

__construct()  : mixed
render()  : string
Renders a value from an interaction into the text a prefix handler would have received.

Constants

ATTACHMENT

public mixed ATTACHMENT = \Discord\Parts\Interactions\Command\Option::ATTACHMENT

BOOLEAN

public mixed BOOLEAN = \Discord\Parts\Interactions\Command\Option::BOOLEAN

CHANNEL

public mixed CHANNEL = \Discord\Parts\Interactions\Command\Option::CHANNEL

INTEGER

public mixed INTEGER = \Discord\Parts\Interactions\Command\Option::INTEGER

NUMBER

public mixed NUMBER = \Discord\Parts\Interactions\Command\Option::NUMBER

ROLE

public mixed ROLE = \Discord\Parts\Interactions\Command\Option::ROLE

STRING

public mixed STRING = \Discord\Parts\Interactions\Command\Option::STRING

USER

public mixed USER = \Discord\Parts\Interactions\Command\Option::USER

Properties

Methods

__construct()

public __construct(string $name, string $description[, int $type = self::STRING ][, bool $required = false ]) : mixed
Parameters
$name : string
$description : string
$type : int = self::STRING
$required : bool = false

render()

Renders a value from an interaction into the text a prefix handler would have received.

public render(mixed $value) : string

This is what lets one handler serve both surfaces. A CHANNEL option arrives as a bare snowflake, but the prefix handler parses <#id> because that is what someone types in Discord — so it is given <#id>, and neither handler needs to know which surface it is on.

Parameters
$value : mixed
Return values
string
On this page

Search results