feat: new chain

This commit is contained in:
hashbro
2026-08-11 02:26:43 +08:00
parent ec2d9f2308
commit 9bf769b2bd
56 changed files with 3806 additions and 325 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Telegram\Middleware;
use App\Telegram\TelegramBotContext;
use SergiX44\Nutgram\Nutgram;
/** Blocks /transfer (and similar) on agent bots. */
class OfficialOnly
{
public function __construct(
private readonly TelegramBotContext $context,
) {}
public function __invoke(Nutgram $bot, callable $next): mixed
{
if (! $this->context->isOfficial()) {
$bot->sendMessage('⛔ /transfer 仅限官方机器人使用');
return null;
}
return $next($bot);
}
}