Skip to content

Commit

Permalink
Implement Sticker Choosing Action (#3144)
Browse files Browse the repository at this point in the history
  • Loading branch information
New-dev0 committed Sep 1, 2021
1 parent 2182e7f commit 391fbab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions telethon/client/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class _ChatAction:
'contact': types.SendMessageChooseContactAction(),
'game': types.SendMessageGamePlayAction(),
'location': types.SendMessageGeoLocationAction(),
'sticker': types.SendMessageChooseStickerAction(),

'record-audio': types.SendMessageRecordAudioAction(),
'record-voice': types.SendMessageRecordAudioAction(), # alias
Expand Down Expand Up @@ -773,6 +774,7 @@ def action(
* ``'contact'``: choosing a contact.
* ``'game'``: playing a game.
* ``'location'``: choosing a geo location.
* ``'sticker'``: choosing a sticker.
* ``'record-audio'``: recording a voice note.
You may use ``'record-voice'`` as alias.
* ``'record-round'``: recording a round video.
Expand Down
9 changes: 9 additions & 0 deletions telethon/events/userupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def uploading(self):
"""
return isinstance(self.action, (
types.SendMessageChooseContactAction,
types.SendMessageChooseStickerAction,
types.SendMessageUploadAudioAction,
types.SendMessageUploadDocumentAction,
types.SendMessageUploadPhotoAction,
Expand Down Expand Up @@ -228,6 +229,14 @@ def document(self):
"""
return isinstance(self.action, types.SendMessageUploadDocumentAction)

@property
@_requires_action
def sticker(self):
"""
`True` if what's being uploaded is a sticker.
"""
return isinstance(self.action, types.SendMessageChooseStickerAction)

@property
@_requires_action
def photo(self):
Expand Down

0 comments on commit 391fbab

Please sign in to comment.