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
@@ -0,0 +1,21 @@
<?php
namespace App\Telegram\Middleware;
use App\Telegram\TelegramBotContext;
use SergiX44\Nutgram\Nutgram;
/** Blocks /transfer (and similar) on agent bots. */
class OfficialBotOnly
{
public function __invoke(Nutgram $bot, callable $next): mixed
{
if (! app(TelegramBotContext::class)->isOfficial()) {
$bot->sendMessage('⛔ /transfer 仅限官方系统群使用');
return null;
}
return $next($bot);
}
}