v2.15.0
·
109 commits
to master
since this release
2.15.0 - 2023-05-31
Added
dependencies.add_cooldownanddependencies.add_concurrency_limitfunctions which act as non-decorator equivalents of the relevant"with_"functions.AbstractCooldownManager.acquiremethod which returns an async context manager which acquires and releases a cooldown lock for you.AbstractConcurrencyLimiter.acquiremethod which returns an async context manager which acquires and releases a concurrency lock for you.- System for using custom cooldown bucket implementations with the standard cooldown manager using
InMemoryCooldownManager.set_custom_bucket. - System for using custom concurrency limiter bucket implementations with the standard concurrency limiter manager using
InMemoryConcurrencyLimiter.set_custom_bucket. unknown_messageoption forCooldownPreExecution.__init__andwith_cooldownfor setting the response message specifically for the new case of whenwait_untilis unknown.
Changed
InMemoryCooldownManagernow uses a sliding ratelimit approach rather than fixed window. This also now waits until the command call has finished before starting the countdown for expiring that specific call.- The datetime passed to
with_cooldown'serrorcallback can now also beNonewhen it's unknown.
Deprecated
AbstractCooldownManager.check_cooldownandAbstractCooldownManager.increment_cooldownin favour of theAbstractCooldownManager.try_acquireandAbstractCooldownManager.releaseinterfaces.