aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/utils/channel.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-02-23 00:59:09 +0000
committerGravatar Chris Lovering <[email protected]>2022-02-24 17:32:48 +0000
commitaa2f9685c29d46a2666654c545d4461763c903b6 (patch)
tree20680504d6049f1f306e06fbb37f99293e8e78f2 /botcore/utils/channel.py
parentBreaking change notice due to regex move (diff)
Alter docstrings to look better in autodocs
Diffstat (limited to 'botcore/utils/channel.py')
-rw-r--r--botcore/utils/channel.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/botcore/utils/channel.py b/botcore/utils/channel.py
index 7e0fc387..6a630c94 100644
--- a/botcore/utils/channel.py
+++ b/botcore/utils/channel.py
@@ -1,4 +1,4 @@
-"""Utilities for interacting with discord channels."""
+"""Useful helper functions for interacting with various discord.py channel objects."""
import discord
from discord.ext.commands import Bot
@@ -9,7 +9,16 @@ log = loggers.get_logger(__name__)
def is_in_category(channel: discord.TextChannel, category_id: int) -> bool:
- """Return True if `channel` is within a category with `category_id`."""
+ """
+ Return whether the given channel has the category_id.
+
+ Args:
+ channel: The channel to check.
+ category_id: The category to check for.
+
+ Returns:
+ A bool depending on whether the channel is in the category.
+ """
return getattr(channel, "category_id", None) == category_id