Skip to content

Commit

Permalink
fix: is_owner() user type hint (Pycord-Development#2593)
Browse files Browse the repository at this point in the history
* fix(is_owner) `user` type hint

The `user` parameter must accept both a `User` and a `Member`, as the docstring itself says.

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

* Update CHANGELOG.md

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

---------

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>
  • Loading branch information
controlado authored Sep 30, 2024
1 parent d39caa0 commit c430fbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas
documentation. ([#2581](https://github.com/Pycord-Development/pycord/pull/2581))
- Fixed a possible bug where audio would play too fast at the beginning of audio files.
([#2584](https://github.com/Pycord-Development/pycord/pull/2584))
- Fixed the `is_owner()` `user` type hint: `User` -> `User | Member`.
([#2593](https://github.com/Pycord-Development/pycord/pull/2593))

### Changed

Expand Down
4 changes: 2 additions & 2 deletions discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ def after_invoke(self, coro):
self._after_invoke = coro
return coro

async def is_owner(self, user: User) -> bool:
async def is_owner(self, user: User | Member) -> bool:
"""|coro|
Checks if a :class:`~discord.User` or :class:`~discord.Member` is the owner of
Expand All @@ -1422,7 +1422,7 @@ async def is_owner(self, user: User) -> bool:
Parameters
----------
user: :class:`.abc.User`
user: Union[:class:`.abc.User`, :class:`.member.Member`]
The user to check for.
Returns
Expand Down

0 comments on commit c430fbb

Please sign in to comment.