webmasterskaya/tbc-remove-voice-video-chat-messages

Telegram机器人命令,用于删除置顶消息

1.0.0 2024-03-01 00:31 UTC

This package is auto-updated.

Last update: 2024-09-30 02:05:30 UTC


README

[!注意] 针对GitHub用户! 这是一个镜像!所有开发都发生在 这里 | 所有开发都在 这里 进行

自动删除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\RemoveVoiceVideoChatMessagesCommand::class);

$telegram->handle();
// OR
$telegram->handleGetUpdates();

需要手动运行该命令!例如,在初始化应用程序的 UpdateFilter

$telegram->setUpdateFilter(function (Update $update, Telegram $telegram, &$reason = 'Update denied by update_filter') {

    $telegram->executeCommand('removevoicevideochatmessages');

    return true;
});