[feat] 新增telegram机器人/start指令

This commit is contained in:
LinusX 2024-06-15 02:16:54 +08:00
parent bab7ed8e97
commit 8cc247b653
No known key found for this signature in database
2 changed files with 18 additions and 1 deletions

View File

@ -7,7 +7,7 @@ use App\Plugins\Telegram\Telegram;
class GetLatestUrl extends Telegram {
public $command = '/getlatesturl';
public $description = '将Telegram账号绑定到网站';
public $description = '获取网站最新网址';
public function handle($message, $match = []) {
$telegramService = $this->telegramService;

View File

@ -0,0 +1,17 @@
<?php
namespace App\Plugins\Telegram\Commands;
use App\Plugins\Telegram\Telegram;
class Start extends Telegram {
public $command = '/start';
public $description = 'telegram机器人初始化';
public function handle($message, $match = []) {
if (!$message->is_private) return;
$telegramService = $this->telegramService;
$text = "/start 显示所有可用指令\n /bind+空格+订阅链接将telegram绑定至账户\n /traffic 获取当前使用流量 \n /getlatesturl 获取网站最新网址 \n /unbind 解绑telegram账户";
$telegramService->sendMessage($message->chat_id, $text, 'markdown');
}
}