diff options
author | 2019-09-09 16:37:13 -0400 | |
---|---|---|
committer | 2019-09-09 16:37:13 -0400 | |
commit | 4b18d7e430d5cea16406c65349718f72919c01c3 (patch) | |
tree | 7fc4f6a0aea2d16e0409723d205c1ab45dcd920f /bot/decorators.py | |
parent | Initial linting pass (diff) |
Lint remaining files
hacktoberstats cog handled in separate PR
Diffstat (limited to 'bot/decorators.py')
-rw-r--r-- | bot/decorators.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/decorators.py b/bot/decorators.py index e12c3f34..dbaad4a2 100644 --- a/bot/decorators.py +++ b/bot/decorators.py @@ -117,7 +117,7 @@ def override_in_channel(func: typing.Callable) -> typing.Callable: return func -def locked(): +def locked() -> typing.Union[typing.Callable, None]: """ Allows the user to only run one instance of the decorated command at a time. @@ -125,11 +125,11 @@ def locked(): This decorator has to go before (below) the `command` decorator. """ - def wrap(func: typing.Callable): + def wrap(func: typing.Callable) -> typing.Union[typing.Callable, None]: func.__locks = WeakValueDictionary() @wraps(func) - async def inner(self, ctx: Context, *args, **kwargs): + async def inner(self: typing.Callable, ctx: Context, *args, **kwargs) -> typing.Union[typing.Callable, None]: lock = func.__locks.setdefault(ctx.author.id, Lock()) if lock.locked(): embed = Embed() |