Search by

top-tl / toptl-php-telegram-bot

Dramex

longman/telegram-bot plugin for TOP.TL — autopost bot stats & check votes.

v0.1.0 2026-04-21 23:38 UTC

This package is not auto-updated.

Last update: 2026-09-09 23:34:19 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