mirror of
https://github.com/v2board/v2board.git
synced 2025-07-31 20:39:36 +08:00
update: telegram bot modularization
This commit is contained in:
22
app/Plugins/Telegram/Commands/Help.php
Normal file
22
app/Plugins/Telegram/Commands/Help.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Plugins\Telegram\Commands;
|
||||
|
||||
use App\Plugins\Telegram\Telegram;
|
||||
|
||||
class Help extends Telegram {
|
||||
public $command = '/help';
|
||||
public $description = '获取帮助';
|
||||
|
||||
public function handle($message, $match = []) {
|
||||
if (!$message->is_private) return;
|
||||
$commands = [
|
||||
'/bind 订阅地址 - 绑定你的' . config('v2board.app_name', 'V2Board') . '账号',
|
||||
'/traffic - 查询流量信息',
|
||||
'/getlatesturl - 获取最新的' . config('v2board.app_name', 'V2Board') . '网址',
|
||||
'/unbind - 解除绑定'
|
||||
];
|
||||
$text = implode(PHP_EOL, $commands);
|
||||
$this->telegramService->sendMessage($message->chat_id, "你可以使用以下命令进行操作:\n\n$text", 'markdown');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user