Expand description
Teloxide plugin for TOP.TL — autopost stats, gate handlers behind votes, handle vote webhooks.
§Quick start
use std::time::Duration;
use toptl::TopTL;
use toptl_teloxide::TopTLPlugin;
#[tokio::main]
async fn main() {
let client = TopTL::new("toptl_xxx");
let plugin = TopTLPlugin::new(client, "mybot");
plugin.start(Duration::from_secs(30 * 60));
// Call plugin.record(...) from your handlers, or use
// record_update(&plugin, &msg).await when the "teloxide"
// feature is enabled.
}Structs§
- Stats
Payload - Payload for
post_stats. All fields are optional — the server only updates the ones you send, so you can push a member-count-only update without zeroing out group/channel counts. - TopTL
- Async client for the TOP.TL public API.
- TopTL
Plugin - Tracks unique users / groups / channels and autoposts counts to TOP.TL.
Enums§
- Chat
Kind - Chat kind for
TopTLPlugin::record.
Functions§
- record_
update - Helper that records every teloxide
Messageinto the plugin.