✨ Add Request and validation
This commit is contained in:
@@ -9,18 +9,21 @@ class Help implements Icommands
|
||||
|
||||
public static function getMessage(Bot $bot, array $data): void
|
||||
{
|
||||
$message = 'Voici la liste de mes commandes : '."\n";
|
||||
$bot->replyPolitely('Voici la liste de mes commandes');
|
||||
|
||||
$message = '|Nom|Description|Pattern|'."\n";
|
||||
$message .= '|---|---|---|'."\n";
|
||||
foreach ($bot->listCommands() as $command) {
|
||||
$message .= sprintf(
|
||||
'%s : %s (%s)%s',
|
||||
$command,
|
||||
'|%s|%s|`%s`|%s',
|
||||
end(explode('\\', $command)),
|
||||
call_user_func([$command, 'getDescription']),
|
||||
call_user_func([$command, 'getPattern']),
|
||||
str_replace('|', '\|', call_user_func([$command, 'getPattern'])),
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
|
||||
$bot->replyPolitely($message);
|
||||
$bot->reply($message);
|
||||
}
|
||||
|
||||
public static function getDescription(): string
|
||||
|
Reference in New Issue
Block a user