webmasterskaya / tbc-remove-join-messages
Telegram机器人命令用于移除加入频道消息
1.0.0
2024-03-01 00:11 UTC
Requires
- php: ^7.3|^8.0
- longman/telegram-bot: ^0.82.0
This package is auto-updated.
Last update: 2024-09-30 01:49:13 UTC
README
[!注意] 对于GitHub用户! 这只是一个镜像!所有开发都在这里进行:这里 | Все разработка ведётся здесь
自动删除关于用户加入和离开Telegram频道的消息。
自动删除关于用户在Telegram频道中加入和退出的消息。
加入项目
根据需要安装包
composer require webmasterskaya/tbc-remove-join-messages
在应用程序初始化时注册命令类。
$bot_api_key = 'your:bot_api_key';
$bot_username = 'username_bot';
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram->addCommandClass(\Webmasterskaya\TelegramBotCommands\Commands\SystemCommands\RemoveJoinMessagesCommand::class);
$telegram->handle();
// OR
$telegram->handleGetUpdates();
需要手动运行命令!!! 例如,在初始化应用程序时,在 UpdateFilter
$telegram->setUpdateFilter(function (Update $update, Telegram $telegram, &$reason = 'Update denied by update_filter') {
$telegram->executeCommand('removejoinmessages');
return true;
});