mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
pyrofork: add ability to specify our own interactions in send_chat_action
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
f03f5ffd79
commit
f84e1f6a5e
2 changed files with 21 additions and 10 deletions
|
|
@ -33,7 +33,8 @@ class SendChatAction:
|
|||
message_thread_id: int = None,
|
||||
business_connection_id: str = None,
|
||||
emoji: str = None,
|
||||
emoji_message_id: int = None
|
||||
emoji_message_id: int = None,
|
||||
emoji_message_interaction: "raw.types.DataJSON" = None
|
||||
) -> bool:
|
||||
"""Tell the other party that something is happening on your side.
|
||||
|
||||
|
|
@ -63,6 +64,9 @@ class SendChatAction:
|
|||
emoji_message_id (``int``, *optional*):
|
||||
Message identifier of the message containing the animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
||||
|
||||
emoji_message_interaction (:obj:`raw.types.DataJSON`, *optional*):
|
||||
Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
||||
|
||||
Returns:
|
||||
``bool``: On success, True is returned.
|
||||
|
||||
|
|
@ -105,13 +109,11 @@ class SendChatAction:
|
|||
raise ValueError(
|
||||
"Invalid Argument Provided"
|
||||
)
|
||||
_, sticker_set = await self._get_raw_stickers(
|
||||
raw.types.InputStickerSetAnimatedEmojiAnimations()
|
||||
)
|
||||
action = action.value(
|
||||
emoticon=emoji,
|
||||
msg_id=emoji_message_id,
|
||||
interaction=raw.types.DataJSON(
|
||||
if emoji_message_interaction is None:
|
||||
_, sticker_set = await self._get_raw_stickers(
|
||||
raw.types.InputStickerSetAnimatedEmojiAnimations()
|
||||
)
|
||||
emoji_message_interaction = raw.types.DataJSON(
|
||||
data=dumps(
|
||||
{
|
||||
"v": 1,
|
||||
|
|
@ -127,6 +129,10 @@ class SendChatAction:
|
|||
}
|
||||
)
|
||||
)
|
||||
action = action.value(
|
||||
emoticon=emoji,
|
||||
msg_id=emoji_message_id,
|
||||
interaction=emoji_message_interaction
|
||||
)
|
||||
else:
|
||||
action = action.value()
|
||||
|
|
|
|||
|
|
@ -1891,7 +1891,8 @@ class Message(Object, Update):
|
|||
action: "enums.ChatAction",
|
||||
business_connection_id: str = None,
|
||||
emoji: str = None,
|
||||
emoji_message_id: int = None
|
||||
emoji_message_id: int = None,
|
||||
emoji_message_interaction: "raw.types.DataJSON" = None
|
||||
) -> bool:
|
||||
"""Bound method *reply_chat_action* of :obj:`~pyrogram.types.Message`.
|
||||
|
||||
|
|
@ -1927,6 +1928,9 @@ class Message(Object, Update):
|
|||
emoji_message_id (``int``, *optional*):
|
||||
Message identifier of the message containing the animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
||||
|
||||
emoji_message_interaction (:obj:`raw.types.DataJSON`, *optional*):
|
||||
Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
||||
|
||||
Returns:
|
||||
``bool``: On success, True is returned.
|
||||
|
||||
|
|
@ -1942,7 +1946,8 @@ class Message(Object, Update):
|
|||
business_connection_id=business_connection_id,
|
||||
action=action,
|
||||
emoji=emoji,
|
||||
emoji_message_id=emoji_message_id
|
||||
emoji_message_id=emoji_message_id,
|
||||
emoji_message_interaction=emoji_message_interaction
|
||||
)
|
||||
|
||||
async def reply_contact(
|
||||
|
|
|
|||
Loading…
Reference in a new issue