pub struct TopTLPlugin { /* private fields */ }Expand description
Tracks unique users / groups / channels and autoposts counts to TOP.TL.
Implementations§
Source§impl TopTLPlugin
impl TopTLPlugin
pub fn new(client: TopTL, username: impl Into<String>) -> Self
Sourcepub async fn record(&self, user_id: Option<i64>, chat: Option<(i64, ChatKind)>)
pub async fn record(&self, user_id: Option<i64>, chat: Option<(i64, ChatKind)>)
Record one update’s IDs into the plugin’s counters. Call from
your handler, or use record_update when the teloxide
feature is enabled.
Sourcepub fn start(&self, interval: Duration)
pub fn start(&self, interval: Duration)
Spawn a background task that flushes stats to TOP.TL every
interval. Keep the plugin alive for the lifetime of your bot.
Trait Implementations§
Source§impl Clone for TopTLPlugin
impl Clone for TopTLPlugin
Source§fn clone(&self) -> TopTLPlugin
fn clone(&self) -> TopTLPlugin
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TopTLPlugin
impl !RefUnwindSafe for TopTLPlugin
impl Send for TopTLPlugin
impl Sync for TopTLPlugin
impl Unpin for TopTLPlugin
impl UnsafeUnpin for TopTLPlugin
impl !UnwindSafe for TopTLPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more