DiscordPHP-MTG Documentation

CommandSignature
in package

FinalYes

The parts of an application command that matter to a user, in one canonical shape — so a command built in code can be compared with the one Discord has registered, and re-registered only when it changed.

Both sides are plain arrays: a CommandBuilder::jsonSerialize(), or a registered Command part round-tripped through JSON. Defaults are filled in (an option is not required unless it says so), localizations are ignored.

Tags
see
MTG::defineCommand()
since
1.1.0

Table of Contents

Methods

of()  : array<string|int, mixed>
The canonical signature of a command.
same()  : bool
Whether two commands are the same to a user.
options()  : array<string|int, mixed>
sorted()  : array<string|int, int>|null
A list of numbers, sorted; null and empty are the same.

Methods

of()

The canonical signature of a command.

public static of(array<string|int, mixed> $command) : array<string|int, mixed>
Parameters
$command : array<string|int, mixed>
Return values
array<string|int, mixed>

same()

Whether two commands are the same to a user.

public static same(array<string|int, mixed> $a, array<string|int, mixed> $b) : bool
Parameters
$a : array<string|int, mixed>
$b : array<string|int, mixed>
Return values
bool

options()

private static options(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Return values
array<string|int, mixed>

sorted()

A list of numbers, sorted; null and empty are the same.

private static sorted(mixed $values) : array<string|int, int>|null
Parameters
$values : mixed
Return values
array<string|int, int>|null
On this page

Search results