gaato/discord/cooldown does not have a README file
pub(open) trait CooldownStore {
async fn try_acquire(Self, key : String, window_ms~ : Int64) -> CooldownDecision
}pub struct InMemoryCooldownStore {
// private fields
}impl CooldownStore for InMemoryCooldownStoreasync fn try_acquire(self : InMemoryCooldownStore, key : String, window_ms~ : Int64) -> CooldownDecisionasync test {
let store = @cooldown.InMemoryCooldownStore(now=() => 1_000L)
assert_eq(store.try_acquire("1:ping|global", window_ms=10_000L), Acquired)
assert_eq(
store.try_acquire("1:ping|global", window_ms=10_000L),
Active(retry_after_ms=10_000L),
)
}async fn InMemoryCooldownStore::try_acquire(self : InMemoryCooldownStore, key : String, window_ms~ : Int64) -> CooldownDecisionInstall
Download zipAn experimental Discord library for MoonBit: native/JS/Wasm REST, interactions, and gateway bots; native voice with DAVE E2EE.
Dependencies