top-tl / toptl-php-telegram-bot
longman/telegram-bot plugin for TOP.TL — autopost bot stats & check votes.
v0.1.0
2026-04-21 23:38 UTC
Requires
- php: >=8.1
- top-tl/toptl: ^0.1.0
Suggests
- longman/telegram-bot: The php-telegram-bot framework this plugin targets
This package is not auto-updated.
Last update: 2026-04-22 21:27:57 UTC
README
PHP Telegram Bot plugin for TOP.TL — automatically post bot stats and check user votes.
Installation
composer require top-tl/toptl-php-telegram-bot
Usage
use TopTL\Client as TopTLClient; use TopTL\PhpTelegramBot\TopTLPlugin; $client = new TopTLClient('your-toptl-token'); $plugin = new TopTLPlugin($client, 'my_bot'); // In your bot's update handling loop: foreach ($updates as $update) { $plugin->handleUpdate($update); // ... your command handling ... } // Post stats (call periodically, e.g. via cron): $plugin->postStats(); // Check if a user voted: if ($plugin->hasVoted($userId)) { // User has voted }
License
MIT