Struct rustrict::Context [−][src]
pub struct Context { /* fields omitted */ }Expand description
Context is useful for taking moderation actions on a per-user basis i.e. each user would get their own Context.
Implementations
rate_limit is minimum time between messages. burst allows a certain amount of messages beyond the rate limit.
Takes user message, returns censored message trimmed of whitespace (if it should be sent)
or BlockReason (explaining why it should be blocked entirely).
Manually mute this user’s messages for a duration. Overwrites any previous manual mute.
Passing Duration::ZERO will therefore un-mute.
Call if another user “reports” this user’s message(s). The function of reports is for suspicion of bad behavior to be confirmed faster.
Returns number of reports received via Self::report(). It is not guaranteed that the full
range of usize of reports will be counted (currently only u8::MAX are counted).
Returns total number of messages processed. It is not guaranteed that the full
range of usize of messages will be counted (currently only u16::MAX are counted).
Returns total number of messages processed that were Type::INAPPROPRIATE. It is not
guaranteed that the full range of usize of messages will be counted (currently only
u16::MAX are counted).
