aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-05-27 13:27:34 +0200
committerGravatar Leon Sandøy <[email protected]>2020-05-27 13:27:34 +0200
commitdb0a384e91a463ff9668ab4f9ea5268aa332ab2d (patch)
tree65ecc6fe8f0b6bc3dd053926da1ebef769b3ddea
parentMerge branch 'master' into moderation_commands_in_modmail_category (diff)
Remove the now deprecated in_channel_check.
This check was no longer being used anywhere, having been replaced by in_whitelist_check.
-rw-r--r--bot/utils/checks.py8
-rw-r--r--tests/bot/utils/test_checks.py8
2 files changed, 0 insertions, 16 deletions
diff --git a/bot/utils/checks.py b/bot/utils/checks.py
index d5ebe4ec9..f0ef36302 100644
--- a/bot/utils/checks.py
+++ b/bot/utils/checks.py
@@ -120,14 +120,6 @@ def without_role_check(ctx: Context, *role_ids: int) -> bool:
return check
-def in_channel_check(ctx: Context, *channel_ids: int) -> bool:
- """Checks if the command was executed inside the list of specified channels."""
- check = ctx.channel.id in channel_ids
- log.trace(f"{ctx.author} tried to call the '{ctx.command.name}' command. "
- f"The result of the in_channel check was {check}.")
- return check
-
-
def cooldown_with_role_bypass(rate: int, per: float, type: BucketType = BucketType.default, *,
bypass_roles: Iterable[int]) -> Callable:
"""
diff --git a/tests/bot/utils/test_checks.py b/tests/bot/utils/test_checks.py
index 9610771e5..d572b6299 100644
--- a/tests/bot/utils/test_checks.py
+++ b/tests/bot/utils/test_checks.py
@@ -41,11 +41,3 @@ class ChecksTests(unittest.TestCase):
role_id = 42
self.ctx.author.roles.append(MockRole(id=role_id))
self.assertTrue(checks.without_role_check(self.ctx, role_id + 10))
-
- def test_in_channel_check_for_correct_channel(self):
- self.ctx.channel.id = 42
- self.assertTrue(checks.in_channel_check(self.ctx, *[42]))
-
- def test_in_channel_check_for_incorrect_channel(self):
- self.ctx.channel.id = 42 + 10
- self.assertFalse(checks.in_channel_check(self.ctx, *[42]))