aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-11-27 19:56:08 +0000
committerGravatar GitHub <[email protected]>2022-11-27 19:56:08 +0000
commit206115f7118187e6f70a8d09c3225d9079bdb5db (patch)
tree48bda4541a302aa0c3326d9c0c0ed4a01d6ef01e
parentUpdate return.md (#2325) (diff)
parentMerge branch 'main' into improve-get-or-fetch-channel-type-hints (diff)
Merge pull request #2347 from shtlrs/improve-get-or-fetch-channel-type-hints
include Thread & PrivateChannel in get_or_fetch_channel return types
-rw-r--r--bot/utils/channel.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/utils/channel.py b/bot/utils/channel.py
index 821a3732a..20f433a3f 100644
--- a/bot/utils/channel.py
+++ b/bot/utils/channel.py
@@ -48,7 +48,9 @@ def is_in_category(channel: discord.TextChannel, category_id: int) -> bool:
return getattr(channel, "category_id", None) == category_id
-async def get_or_fetch_channel(channel_id: int) -> discord.abc.GuildChannel:
+async def get_or_fetch_channel(
+ channel_id: int
+) -> discord.abc.GuildChannel | discord.abc.PrivateChannel | discord.Thread:
"""Attempt to get or fetch a channel and return it."""
log.trace(f"Getting the channel {channel_id}.")