diff options
| author | 2020-07-18 13:36:45 -0700 | |
|---|---|---|
| committer | 2020-07-31 23:01:26 -0700 | |
| commit | bb0cb84546820b9399c2b08edda641b079898538 (patch) | |
| tree | c62a12e0e027f989ccd6325d5ab2c6b381120e6d | |
| parent | Decorators: remove default value for respect_role_hierarchy (diff) | |
Decorators: use type aliases from function module
| -rw-r--r-- | bot/decorators.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bot/decorators.py b/bot/decorators.py index 6b2214f53..eefe2f9ba 100644 --- a/bot/decorators.py +++ b/bot/decorators.py @@ -18,10 +18,8 @@ from bot.utils.checks import in_whitelist_check, with_role_check, without_role_c log = logging.getLogger(__name__) __lock_dicts = defaultdict(WeakValueDictionary) -Argument = t.Union[int, str] -BoundArgs = t.OrderedDict[str, t.Any] _IdCallableReturn = t.Union[t.Hashable, t.Awaitable[t.Hashable]] -_IdCallable = t.Callable[[BoundArgs], _IdCallableReturn] +_IdCallable = t.Callable[[function.BoundArgs], _IdCallableReturn] ResourceId = t.Union[t.Hashable, _IdCallable] @@ -200,7 +198,7 @@ def redirect_output(destination_channel: int, bypass_roles: t.Container[int] = N return wrap -def respect_role_hierarchy(name_or_pos: Argument) -> t.Callable: +def respect_role_hierarchy(name_or_pos: function.Argument) -> t.Callable: """ Ensure the highest role of the invoking member is greater than that of the target member. |