Skip to content

Commit

Permalink
Add message entitiy type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
z44d committed Sep 27, 2024
1 parent bca0322 commit a6b163e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions tgram/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,27 @@

ParseMode = _Literal["Markdown", "MarkdownV2", "HTML"]
ChatType = _Literal["private", "group", "supergroup", "channel"]
MessageEntityType = _Literal[
"mention",
"hashtag",
"cashtag",
"bot_command",
"url",
"email",
"phone_number",
"bold",
"italic",
"underline",
"strikethrough",
"spoiler",
"blockquote",
"expandable_blockquote",
"code",
"pre",
"text_link",
"text_mention",
"custom_emoji",
]

__all__ = [
"Animation",
Expand Down Expand Up @@ -513,4 +534,5 @@
"WriteAccessAllowed",
"ParseMode",
"ChatType",
"MessageEntityType",
]
2 changes: 1 addition & 1 deletion tgram/types/_message_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MessageEntity(Type_):

def __init__(
self,
type: "str" = None,
type: "tgram.types.MessageEntityType" = None,
offset: "int" = None,
length: "int" = None,
url: "str" = None,
Expand Down

0 comments on commit a6b163e

Please sign in to comment.