@@ -113,8 +113,6 @@ async def command():
113
113
This call resulted in a cooldown being put into effect.
114
114
"""
115
115
116
- self .triggered = False
117
-
118
116
self .limit = limit
119
117
self .time_period = time_period
120
118
self .bucket = bucket
@@ -172,7 +170,6 @@ async def trigger(self, time_period: Union[float, datetime.timedelta]) -> None:
172
170
time_period : `Union[float, datetime.timedelta]`
173
171
The time period that cooldwon will remain triggered.
174
172
"""
175
- self .triggered = True
176
173
self .trigger_cooldown .time_period = (
177
174
time_period
178
175
if isinstance (time_period , (float , int ))
@@ -217,6 +214,7 @@ def __call__(self, func: Callable) -> Callable:
217
214
f"Expected `func` to be a coroutine, "
218
215
f"found { func } of type { func .__class__ .__name__ !r} instead" # noqa
219
216
)
217
+
220
218
# Links the cooldowns to the given function.
221
219
_cooldown ._func = func
222
220
_trigger_cooldown ._func = func
@@ -253,9 +251,7 @@ async def inner(*args, **kwargs):
253
251
else :
254
252
result = await func (* args , ** kwargs )
255
253
return result
256
- # If not, untrigger the cooldown.
257
- # else:
258
- # self.triggered = False
254
+
259
255
# If the cooldown is not triggered.
260
256
# Runs the normal Cooldown.
261
257
async with _cooldown (* args , ** kwargs ):
@@ -265,5 +261,6 @@ async def inner(*args, **kwargs):
265
261
else :
266
262
result = await func (* args , ** kwargs )
267
263
return result
264
+
268
265
# Return the decorator.
269
266
return inner
0 commit comments