getUpdate(); $Message = $Update->getMessage(); if ($Message->getChat()->getId() < 0) { if (Setting::obtain('telegram_group_quiet') === true) { return; } } if (! preg_match('/^\/help\s?(@' . $_ENV['telegram_bot'] . ')?.*/i', $Message->getText())) { if (Setting::obtain('help_any_command') === false) { return; } } $this->replyWithChatAction(['action' => Actions::TYPING]); $commands = $this->telegram->getCommands(); $text = '系统中可用的所有命令.'; $text .= PHP_EOL . PHP_EOL; foreach ($commands as $name => $handler) { $text .= '/' . $name . PHP_EOL . '` - ' . $handler->getDescription() . '`' . PHP_EOL; } $this->replyWithMessage( [ 'text' => $text, 'parse_mode' => 'Markdown', 'disable_web_page_preview' => false, 'reply_to_message_id' => $Message->getMessageId(), 'reply_markup' => null, ] ); } }