mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-02 07:28:13 -05:00
[feat] 新增telegram机器人/start指令
This commit is contained in:
parent
bab7ed8e97
commit
8cc247b653
@ -7,7 +7,7 @@ use App\Plugins\Telegram\Telegram;
|
|||||||
|
|
||||||
class GetLatestUrl extends Telegram {
|
class GetLatestUrl extends Telegram {
|
||||||
public $command = '/getlatesturl';
|
public $command = '/getlatesturl';
|
||||||
public $description = '将Telegram账号绑定到网站';
|
public $description = '获取网站最新网址';
|
||||||
|
|
||||||
public function handle($message, $match = []) {
|
public function handle($message, $match = []) {
|
||||||
$telegramService = $this->telegramService;
|
$telegramService = $this->telegramService;
|
||||||
|
17
app/Plugins/Telegram/Commands/Start.php
Normal file
17
app/Plugins/Telegram/Commands/Start.php
Normal 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');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user