diff options
author | 2022-11-27 19:56:08 +0000 | |
---|---|---|
committer | 2022-11-27 19:56:08 +0000 | |
commit | 206115f7118187e6f70a8d09c3225d9079bdb5db (patch) | |
tree | 48bda4541a302aa0c3326d9c0c0ed4a01d6ef01e | |
parent | Update return.md (#2325) (diff) | |
parent | Merge 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.py | 4 |
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}.") |