mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04: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,
|
message_thread_id: int = None,
|
||||||
business_connection_id: str = None,
|
business_connection_id: str = None,
|
||||||
emoji: str = None,
|
emoji: str = None,
|
||||||
emoji_message_id: int = None
|
emoji_message_id: int = None,
|
||||||
|
emoji_message_interaction: "raw.types.DataJSON" = None
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Tell the other party that something is happening on your side.
|
"""Tell the other party that something is happening on your side.
|
||||||
|
|
||||||
|
|
@ -63,6 +64,9 @@ class SendChatAction:
|
||||||
emoji_message_id (``int``, *optional*):
|
emoji_message_id (``int``, *optional*):
|
||||||
Message identifier of the message containing the animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
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:
|
Returns:
|
||||||
``bool``: On success, True is returned.
|
``bool``: On success, True is returned.
|
||||||
|
|
||||||
|
|
@ -105,13 +109,11 @@ class SendChatAction:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid Argument Provided"
|
"Invalid Argument Provided"
|
||||||
)
|
)
|
||||||
|
if emoji_message_interaction is None:
|
||||||
_, sticker_set = await self._get_raw_stickers(
|
_, sticker_set = await self._get_raw_stickers(
|
||||||
raw.types.InputStickerSetAnimatedEmojiAnimations()
|
raw.types.InputStickerSetAnimatedEmojiAnimations()
|
||||||
)
|
)
|
||||||
action = action.value(
|
emoji_message_interaction = raw.types.DataJSON(
|
||||||
emoticon=emoji,
|
|
||||||
msg_id=emoji_message_id,
|
|
||||||
interaction=raw.types.DataJSON(
|
|
||||||
data=dumps(
|
data=dumps(
|
||||||
{
|
{
|
||||||
"v": 1,
|
"v": 1,
|
||||||
|
|
@ -127,6 +129,10 @@ class SendChatAction:
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
action = action.value(
|
||||||
|
emoticon=emoji,
|
||||||
|
msg_id=emoji_message_id,
|
||||||
|
interaction=emoji_message_interaction
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
action = action.value()
|
action = action.value()
|
||||||
|
|
|
||||||
|
|
@ -1891,7 +1891,8 @@ class Message(Object, Update):
|
||||||
action: "enums.ChatAction",
|
action: "enums.ChatAction",
|
||||||
business_connection_id: str = None,
|
business_connection_id: str = None,
|
||||||
emoji: str = None,
|
emoji: str = None,
|
||||||
emoji_message_id: int = None
|
emoji_message_id: int = None,
|
||||||
|
emoji_message_interaction: "raw.types.DataJSON" = None
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Bound method *reply_chat_action* of :obj:`~pyrogram.types.Message`.
|
"""Bound method *reply_chat_action* of :obj:`~pyrogram.types.Message`.
|
||||||
|
|
||||||
|
|
@ -1927,6 +1928,9 @@ class Message(Object, Update):
|
||||||
emoji_message_id (``int``, *optional*):
|
emoji_message_id (``int``, *optional*):
|
||||||
Message identifier of the message containing the animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.
|
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:
|
Returns:
|
||||||
``bool``: On success, True is returned.
|
``bool``: On success, True is returned.
|
||||||
|
|
||||||
|
|
@ -1942,7 +1946,8 @@ class Message(Object, Update):
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=business_connection_id,
|
||||||
action=action,
|
action=action,
|
||||||
emoji=emoji,
|
emoji=emoji,
|
||||||
emoji_message_id=emoji_message_id
|
emoji_message_id=emoji_message_id,
|
||||||
|
emoji_message_interaction=emoji_message_interaction
|
||||||
)
|
)
|
||||||
|
|
||||||
async def reply_contact(
|
async def reply_contact(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue