aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/resources/tags/customchecks.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/resources/tags/customchecks.md b/bot/resources/tags/customchecks.md
index b4eb90872..96f833430 100644
--- a/bot/resources/tags/customchecks.md
+++ b/bot/resources/tags/customchecks.md
@@ -4,18 +4,18 @@ You may find yourself in need of a check decorator to do something that doesn't
```py
from discord.ext.commands import check, Context
-def in_channel(*channels):
+def in_any_channel(*channels):
async def predicate(ctx: Context):
return ctx.channel.id in channels
return check(predicate)
```
-There's a fair bit to break down here, so let's start with what we're trying to achieve with this check. As you can probably guess from the name it's locking a command to a list of channels. The inner function named `predicate` is used to perform the actual check on the command context. Here you can do anything that requires a `Context` object. This inner function should return `True` if the check is **successful** or `False` if the check **fails**.
+There's a fair bit to break down here, so let's start with what we're trying to achieve with this check. As you can probably guess from the name it's locking a command to a **list of channels**. The inner function named `predicate` is used to perform the actual check on the command context. Here you can do anything that requires a `Context` object. This inner function should return `True` if the check is **successful** or `False` if the check **fails**.
Here's how we might use our new check:
```py
@bot.command(name="ping")
-@in_channel(728343273562701984)
+@in_any_channel(728343273562701984)
async def ping(ctx: Context):
...
```
-This would lock the `ping` command to only be used in the channel `728343273562701984`.
+This would lock the `ping` command to only be used in the channel `728343273562701984`. If this check function fails it will raise a `CheckFailure` exception, which can be handled in your error handler.