aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/utils/channel.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-03-15 16:25:28 +0400
committerGravatar GitHub <[email protected]>2022-03-15 16:25:28 +0400
commitbc0a470dcd99007581975f23efabbda9266dac9d (patch)
tree6fa9bc28c1b4b8b495be25031eee39cd71e6d824 /botcore/utils/channel.py
parentMerge pull request #37 from python-discord/fix/trace-logging (diff)
parentBump version and document breaking change (diff)
Merge pull request #39 from python-discord/revert-disnakev4.0.0
Revert disnake
Diffstat (limited to 'botcore/utils/channel.py')
-rw-r--r--botcore/utils/channel.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/botcore/utils/channel.py b/botcore/utils/channel.py
index d586098f..c09d53bf 100644
--- a/botcore/utils/channel.py
+++ b/botcore/utils/channel.py
@@ -1,14 +1,14 @@
-"""Useful helper functions for interacting with various disnake channel objects."""
+"""Useful helper functions for interacting with various discord channel objects."""
-import disnake
-from disnake.ext.commands import Bot
+import discord
+from discord.ext.commands import Bot
from botcore.utils import logging
log = logging.get_logger(__name__)
-def is_in_category(channel: disnake.TextChannel, category_id: int) -> bool:
+def is_in_category(channel: discord.TextChannel, category_id: int) -> bool:
"""
Return whether the given ``channel`` in the the category with the id ``category_id``.
@@ -22,22 +22,22 @@ def is_in_category(channel: disnake.TextChannel, category_id: int) -> bool:
return getattr(channel, "category_id", None) == category_id
-async def get_or_fetch_channel(bot: Bot, channel_id: int) -> disnake.abc.GuildChannel:
+async def get_or_fetch_channel(bot: Bot, channel_id: int) -> discord.abc.GuildChannel:
"""
Attempt to get or fetch the given ``channel_id`` from the bots cache, and return it.
Args:
- bot: The :obj:`disnake.ext.commands.Bot` instance to use for getting/fetching.
+ bot: The :obj:`discord.ext.commands.Bot` instance to use for getting/fetching.
channel_id: The channel to get/fetch.
Raises:
- :exc:`disnake.InvalidData`
+ :exc:`discord.InvalidData`
An unknown channel type was received from Discord.
- :exc:`disnake.HTTPException`
+ :exc:`discord.HTTPException`
Retrieving the channel failed.
- :exc:`disnake.NotFound`
+ :exc:`discord.NotFound`
Invalid Channel ID.
- :exc:`disnake.Forbidden`
+ :exc:`discord.Forbidden`
You do not have permission to fetch this channel.
Returns: