@@ -113,8 +113,6 @@ async def command():
113113 This call resulted in a cooldown being put into effect.
114114 """
115115
116- self .triggered = False
117-
118116 self .limit = limit
119117 self .time_period = time_period
120118 self .bucket = bucket
@@ -172,7 +170,6 @@ async def trigger(self, time_period: Union[float, datetime.timedelta]) -> None:
172170 time_period : `Union[float, datetime.timedelta]`
173171 The time period that cooldwon will remain triggered.
174172 """
175- self .triggered = True
176173 self .trigger_cooldown .time_period = (
177174 time_period
178175 if isinstance (time_period , (float , int ))
@@ -217,6 +214,7 @@ def __call__(self, func: Callable) -> Callable:
217214 f"Expected `func` to be a coroutine, "
218215 f"found { func } of type { func .__class__ .__name__ !r} instead" # noqa
219216 )
217+
220218 # Links the cooldowns to the given function.
221219 _cooldown ._func = func
222220 _trigger_cooldown ._func = func
@@ -253,9 +251,7 @@ async def inner(*args, **kwargs):
253251 else :
254252 result = await func (* args , ** kwargs )
255253 return result
256- # If not, untrigger the cooldown.
257- # else:
258- # self.triggered = False
254+
259255 # If the cooldown is not triggered.
260256 # Runs the normal Cooldown.
261257 async with _cooldown (* args , ** kwargs ):
@@ -265,5 +261,6 @@ async def inner(*args, **kwargs):
265261 else :
266262 result = await func (* args , ** kwargs )
267263 return result
264+
268265 # Return the decorator.
269266 return inner
0 commit comments