Skip to content

Commit c430fbb

Browse files
authored
fix: is_owner() user type hint (#2593)
* 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 <[email protected]> * Update CHANGELOG.md Signed-off-by: balaclava <[email protected]> --------- Signed-off-by: balaclava <[email protected]>
1 parent d39caa0 commit c430fbb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas
3333
documentation. ([#2581](https://github.com/Pycord-Development/pycord/pull/2581))
3434
- Fixed a possible bug where audio would play too fast at the beginning of audio files.
3535
([#2584](https://github.com/Pycord-Development/pycord/pull/2584))
36+
- Fixed the `is_owner()` `user` type hint: `User` -> `User | Member`.
37+
([#2593](https://github.com/Pycord-Development/pycord/pull/2593))
3638

3739
### Changed
3840

discord/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ def after_invoke(self, coro):
14071407
self._after_invoke = coro
14081408
return coro
14091409

1410-
async def is_owner(self, user: User) -> bool:
1410+
async def is_owner(self, user: User | Member) -> bool:
14111411
"""|coro|
14121412
14131413
Checks if a :class:`~discord.User` or :class:`~discord.Member` is the owner of
@@ -1422,7 +1422,7 @@ async def is_owner(self, user: User) -> bool:
14221422
14231423
Parameters
14241424
----------
1425-
user: :class:`.abc.User`
1425+
user: Union[:class:`.abc.User`, :class:`.member.Member`]
14261426
The user to check for.
14271427
14281428
Returns

0 commit comments

Comments
 (0)