webmasterskaya / tbc-remove-pinned-messages
Telegram机器人命令,用于删除固定消息
1.0.0
2024-03-01 00:39 UTC
Requires
- php: ^7.3|^8.0
- longman/telegram-bot: ^0.82.0
This package is auto-updated.
Last update: 2024-09-30 01:57:36 UTC
README
自动删除Telegram频道上的固定消息相关消息。
自动删除Telegram频道上关于固定消息的消息。
连接到项目
根据需要安装包
composer require webmasterskaya/tbc-remove-voice-video-chat-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\RemovePinnedMessagesCommand::class);
$telegram->handle();
// OR
$telegram->handleGetUpdates();
需要手动运行命令!例如,在初始化应用程序的UpdateFilter
时
$telegram->setUpdateFilter(function (Update $update, Telegram $telegram, &$reason = 'Update denied by update_filter') {
$telegram->executeCommand('removepinnedmessages');
return true;
});