mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Pyrofork: Add reply_to_story_id and reply_to_story_user_id field to Message
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
2dbbf7707e
commit
fa5539a16d
1 changed files with 32 additions and 18 deletions
|
|
@ -111,6 +111,12 @@ class Message(Object, Update):
|
||||||
reply_to_message_id (``int``, *optional*):
|
reply_to_message_id (``int``, *optional*):
|
||||||
The id of the message which this message directly replied to.
|
The id of the message which this message directly replied to.
|
||||||
|
|
||||||
|
reply_to_story_id (``int``, *optional*):
|
||||||
|
The id of the story which this message directly replied to.
|
||||||
|
|
||||||
|
reply_to_story_user_id (``int``, *optional*):
|
||||||
|
The id of the story sender which this message directly replied to.
|
||||||
|
|
||||||
reply_to_top_message_id (``int``, *optional*):
|
reply_to_top_message_id (``int``, *optional*):
|
||||||
The id of the first message which started this message thread.
|
The id of the first message which started this message thread.
|
||||||
|
|
||||||
|
|
@ -368,6 +374,8 @@ class Message(Object, Update):
|
||||||
forward_date: datetime = None,
|
forward_date: datetime = None,
|
||||||
is_topic_message: bool = None,
|
is_topic_message: bool = None,
|
||||||
reply_to_message_id: int = None,
|
reply_to_message_id: int = None,
|
||||||
|
reply_to_story_id: int = None,
|
||||||
|
reply_to_story_user_id: int = None,
|
||||||
reply_to_top_message_id: int = None,
|
reply_to_top_message_id: int = None,
|
||||||
reply_to_message: "Message" = None,
|
reply_to_message: "Message" = None,
|
||||||
mentioned: bool = None,
|
mentioned: bool = None,
|
||||||
|
|
@ -458,6 +466,8 @@ class Message(Object, Update):
|
||||||
self.forward_date = forward_date
|
self.forward_date = forward_date
|
||||||
self.is_topic_message = is_topic_message
|
self.is_topic_message = is_topic_message
|
||||||
self.reply_to_message_id = reply_to_message_id
|
self.reply_to_message_id = reply_to_message_id
|
||||||
|
self.reply_to_story_id = reply_to_story_id
|
||||||
|
self.reply_to_story_user_id = reply_to_story_user_id
|
||||||
self.reply_to_top_message_id = reply_to_top_message_id
|
self.reply_to_top_message_id = reply_to_top_message_id
|
||||||
self.reply_to_message = reply_to_message
|
self.reply_to_message = reply_to_message
|
||||||
self.mentioned = mentioned
|
self.mentioned = mentioned
|
||||||
|
|
@ -967,6 +977,7 @@ class Message(Object, Update):
|
||||||
)
|
)
|
||||||
|
|
||||||
if message.reply_to:
|
if message.reply_to:
|
||||||
|
if isinstance(message.reply_to, raw.types.MessageReplyHeader):
|
||||||
if message.reply_to.forum_topic:
|
if message.reply_to.forum_topic:
|
||||||
if message.reply_to.reply_to_top_id:
|
if message.reply_to.reply_to_top_id:
|
||||||
thread_id = message.reply_to.reply_to_top_id
|
thread_id = message.reply_to.reply_to_top_id
|
||||||
|
|
@ -987,6 +998,9 @@ class Message(Object, Update):
|
||||||
else:
|
else:
|
||||||
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
|
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
|
||||||
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
|
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
|
||||||
|
else:
|
||||||
|
parsed_message.reply_to_story_id = message.reply_to.story_id
|
||||||
|
parsed_message.reply_to_story_user_id = message.reply_to.user_id
|
||||||
|
|
||||||
if replies:
|
if replies:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue