From 8861c4e9737e26583edf4525a2ad37a8066fd096 Mon Sep 17 00:00:00 2001 From: nulldomain Date: Fri, 8 Dec 2023 20:17:05 +0000 Subject: [PATCH] 2.3.5 * fix: incorrect params used in _get_bucket partial * docs: changelog for previous commit * chore: version bump --- docs/source/changelogs/v2-changelog.rst | 5 +++++ lightbulb/__init__.py | 2 +- lightbulb/decorators.py | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/source/changelogs/v2-changelog.rst b/docs/source/changelogs/v2-changelog.rst index 1aa3e1eb..2bd3bb7a 100644 --- a/docs/source/changelogs/v2-changelog.rst +++ b/docs/source/changelogs/v2-changelog.rst @@ -6,6 +6,11 @@ Below are all the changelogs for the stable versions of hikari-lightbulb (versio ---- +Version 2.3.5 +============= + +- Fix incorrect parameters being passed to _get_bucket which prevented the add_cooldown decorator from functioning correctly. + Version 2.3.4 ============= diff --git a/lightbulb/__init__.py b/lightbulb/__init__.py index 8821447a..30a8ea13 100644 --- a/lightbulb/__init__.py +++ b/lightbulb/__init__.py @@ -191,4 +191,4 @@ from lightbulb.parser import * from lightbulb.plugins import * -__version__ = "2.3.4" +__version__ = "2.3.5" diff --git a/lightbulb/decorators.py b/lightbulb/decorators.py index 62cb5f71..6c88eab5 100644 --- a/lightbulb/decorators.py +++ b/lightbulb/decorators.py @@ -336,12 +336,12 @@ def _get_bucket( ctx: context.base.Context, _bucket: t.Type[buckets.Bucket], _length: float, - _max_usages: int, + _uses: int, _algorithm: t.Type[cooldown_algorithms.CooldownAlgorithm], ) -> buckets.Bucket: - return _bucket(_length, _max_usages, _algorithm) + return _bucket(_length, _uses, _algorithm) - getter = functools.partial(_get_bucket, b=bucket, l=length, u=uses, a=algorithm) + getter = functools.partial(_get_bucket, _bucket=bucket, _length=length, _uses=uses, _algorithm=algorithm) elif callback is not None: getter = callback else: