Skip to content

Commit

Permalink
Update get_or_fetch_channel's return type (#187)
Browse files Browse the repository at this point in the history
* update get_or_fetch_channel's return type

* unindent overly indented signature

* update changelog
  • Loading branch information
shtlrs authored Jul 10, 2023
1 parent f80a263 commit 4c1060a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Changelog
=========

- :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`.

- :release:`9.9.2 <2nd July 2023>`
- :bug:`185` Update expiry label from 1 month to 30 days in paste service.

Expand Down
5 changes: 4 additions & 1 deletion pydis_core/utils/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ 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(bot: Bot, channel_id: int) -> discord.abc.GuildChannel:
async def get_or_fetch_channel(
bot: Bot,
channel_id: int,
) -> discord.abc.GuildChannel | discord.abc.PrivateChannel | discord.Thread:
"""
Attempt to get or fetch the given ``channel_id`` from the bots cache, and return it.
Expand Down

0 comments on commit 4c1060a

Please sign in to comment.