diff options
author | 2022-09-19 12:46:56 +0200 | |
---|---|---|
committer | 2022-09-19 12:46:56 +0200 | |
commit | e94b47fc84704d5b4c945e310caee9a2bbae938a (patch) | |
tree | dd3eb669eda51c88383d9f503d7df538c8be974f /botcore | |
parent | get rid of unnecessary check (diff) |
use ctx.channel directly
Diffstat (limited to 'botcore')
-rw-r--r-- | botcore/utils/cooldown.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/botcore/utils/cooldown.py b/botcore/utils/cooldown.py index 28ad8795..879a2894 100644 --- a/botcore/utils/cooldown.py +++ b/botcore/utils/cooldown.py @@ -195,9 +195,8 @@ def block_duplicate_invocations( async def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: arg_tuple = _create_argument_tuple(*args[2:], **kwargs) # skip self and ctx from the command ctx = typing.cast("Context[BotBase]", args[1]) - channel = ctx.channel - if not isinstance(channel, discord.DMChannel): + if not isinstance(ctx.channel, discord.DMChannel): if mgr.is_on_cooldown(ctx.channel, arg_tuple): if send_notice: with suppress(discord.NotFound): |