Skip to content

Commit 4c1060a

Browse files
authored
Update get_or_fetch_channel's return type (#187)
* update get_or_fetch_channel's return type * unindent overly indented signature * update changelog
1 parent f80a263 commit 4c1060a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
44
Changelog
55
=========
6+
7+
- :bug:`187` Fix :obj:`pydis_core.utils.channel.get_or_fetch_channel`'s return type to include :obj:`discord.abc.PrivateChannel` and :obj:`discord.Thread`.
8+
69
- :release:`9.9.2 <2nd July 2023>`
710
- :bug:`185` Update expiry label from 1 month to 30 days in paste service.
811

pydis_core/utils/channel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def is_in_category(channel: discord.TextChannel, category_id: int) -> bool:
2222
return getattr(channel, "category_id", None) == category_id
2323

2424

25-
async def get_or_fetch_channel(bot: Bot, channel_id: int) -> discord.abc.GuildChannel:
25+
async def get_or_fetch_channel(
26+
bot: Bot,
27+
channel_id: int,
28+
) -> discord.abc.GuildChannel | discord.abc.PrivateChannel | discord.Thread:
2629
"""
2730
Attempt to get or fetch the given ``channel_id`` from the bots cache, and return it.
2831

0 commit comments

Comments
 (0)