Pyrofork: fix derps

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-08-03 02:16:09 +07:00
parent c96bfe8d08
commit c3a61812ef
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -21,7 +21,7 @@ from datetime import datetime
from typing import Union, List, Optional from typing import Union, List, Optional
import pyrogram import pyrogram
from pyrogram import types, enums, raw from pyrogram import types, enums
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -113,27 +113,14 @@ class CopyMessage:
""" """
message: types.Message = await self.get_messages(from_chat_id, message_id) message: types.Message = await self.get_messages(from_chat_id, message_id)
reply_to = None
if reply_to_message_id or message_thread_id:
reply_to_msg_id = None
top_msg_id = None
if message_thread_id:
if not reply_to_message_id:
reply_to_msg_id = message_thread_id
else:
reply_to_msg_id = reply_to_message_id
top_msg_id = message_thread_id
else:
reply_to_msg_id = reply_to_message_id
reply_to = raw.types.InputReplyToMessage(reply_to_msg_id=reply_to_msg_id, top_msg_id=top_msg_id)
return await message.copy( return await message.copy(
chat_id=chat_id, chat_id=chat_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,
caption_entities=caption_entities, caption_entities=caption_entities,
disable_notification=disable_notification, disable_notification=disable_notification,
reply_to=reply_to, message_thread_id=message_thread_id,
reply_to_message_id=reply_to_message_id,
schedule_date=schedule_date, schedule_date=schedule_date,
protect_content=protect_content, protect_content=protect_content,
reply_markup=reply_markup reply_markup=reply_markup