listCommands() as $command) { $message .= sprintf( '%s : %s (%s)%s', $command, call_user_func([$command, 'getDescription']), call_user_func([$command, 'getPattern']), "\n" ); } $bot->replyPolitely($message); } public static function getDescription(): string { return 'Affiche les commandes à lancer'; } public static function getPattern(): string { return '^(help|aide|liste des commandes)$'; } }