aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/utils/channel.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-03-15 12:11:31 +0000
committerGravatar Chris Lovering <[email protected]>2022-03-15 12:11:31 +0000
commitccd16f598ce5088b193c2d6ca800ca7dda79250f (patch)
tree9c1490ada8adb69df9d8a2c7c0b2158cfa4e428c /botcore/utils/channel.py
parentRevert back to discord.py (diff)
Change all instance of disnake to discord
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: