Help.php 781 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Plugins\Telegram\Commands;
  3. use App\Plugins\Telegram\Telegram;
  4. class Help extends Telegram {
  5. public $command = '/help';
  6. public $description = '获取帮助';
  7. public function handle($message, $match = []) {
  8. if (!$message->is_private) return;
  9. $commands = [
  10. '/bind 订阅地址 - 绑定你的' . config('v2board.app_name', 'V2Board') . '账号',
  11. '/traffic - 查询流量信息',
  12. '/getlatesturl - 获取最新的' . config('v2board.app_name', 'V2Board') . '网址',
  13. '/unbind - 解除绑定'
  14. ];
  15. $text = implode(PHP_EOL, $commands);
  16. $this->telegramService->sendMessage($message->chat_id, "你可以使用以下命令进行操作:\n\n$text", 'markdown');
  17. }
  18. }