top-tl/toptl-php-telegram-bot

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

Maintainers

Package info

github.com/top-tl/php-telegram-bot

Homepage

Documentation

pkg:composer/top-tl/toptl-php-telegram-bot

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

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