Skip to content

Commit

Permalink
Improve Emoji.parse typing (#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
beagold authored Apr 7, 2024
1 parent 3e05187 commit af31e9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/1870.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve `Emoji.parse` typing to make it more explicit
4 changes: 2 additions & 2 deletions hikari/emojis.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def mention(self) -> str:
"""Mention string to use to mention the emoji with."""

@classmethod
def parse(cls, string: str, /) -> Emoji:
def parse(cls, string: str, /) -> typing.Union[UnicodeEmoji, CustomEmoji]:
"""Parse a given string into an emoji object.
Parameters
Expand All @@ -91,7 +91,7 @@ def parse(cls, string: str, /) -> Emoji:
Returns
-------
Emoji
typing.Union[UnicodeEmoji, CustomEmoji]
The parsed emoji object. This will be a [`hikari.emojis.CustomEmoji`][] if a custom
emoji mention, or a [`hikari.emojis.UnicodeEmoji`][] otherwise.
Expand Down

0 comments on commit af31e9b

Please sign in to comment.