Skip to content

Commit

Permalink
fix: properly type ApplicationContext.author (#2148)
Browse files Browse the repository at this point in the history
* Update context.py

Updated `author` property of `ApplicationContext` to include typehinting for applicable types.

Signed-off-by: Kyle Pannan <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Kyle Pannan <[email protected]>

* style(pre-commit): auto fixes from pre-commit.com hooks

---------

Signed-off-by: Kyle Pannan <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Yuki-42 and pre-commit-ci[bot] authored Jun 26, 2023
1 parent 297053d commit fa25ccb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ These changes are available on the `master` branch, but have not yet been releas
([#2145](https://github.com/Pycord-Development/pycord/pull/2145))
- Fixed `Thread.applied_tags` not being updated.
([#2146](https://github.com/Pycord-Development/pycord/pull/2146))
- Fixed type-hinting of `author` property of `ApplicationContext` to include typehinting
of `User` or `Member`.
([#2148](https://github.com/Pycord-Development/pycord/pull/2148))

## [2.4.1] - 2023-03-20

Expand Down
2 changes: 1 addition & 1 deletion discord/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def user(self) -> Member | User:
"""
return self.interaction.user # type: ignore # command user will never be None

author = user
author: Member | User = user

@property
def voice_client(self) -> VoiceProtocol | None:
Expand Down

0 comments on commit fa25ccb

Please sign in to comment.