mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrofork: Update some methods to layer 160
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
2762a1e1c6
commit
7089b01402
20 changed files with 313 additions and 20 deletions
|
|
@ -78,6 +78,20 @@ class SendGame:
|
|||
|
||||
await app.send_game(chat_id, "gamename")
|
||||
"""
|
||||
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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
@ -89,7 +103,7 @@ class SendGame:
|
|||
),
|
||||
message="",
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
noforwards=protect_content,
|
||||
reply_markup=await reply_markup.write(self) if reply_markup else None
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@ class SendInlineBotResult:
|
|||
Sends the message silently.
|
||||
Users will receive a notification with no sound.
|
||||
|
||||
message_thread_id (``int``, *optional*):
|
||||
Unique identifier of a message thread to which the message belongs.
|
||||
for supergroups only
|
||||
|
||||
reply_to_message_id (``bool``, *optional*):
|
||||
If the message is a reply, ID of the original message.
|
||||
|
||||
|
|
@ -64,6 +68,21 @@ class SendInlineBotResult:
|
|||
|
||||
await app.send_inline_bot_result(chat_id, query_id, result_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 self.invoke(
|
||||
raw.functions.messages.SendInlineBotResult(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
@ -71,6 +90,6 @@ class SendInlineBotResult:
|
|||
id=result_id,
|
||||
random_id=self.rnd_id(),
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id
|
||||
reply_to=reply_to
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class CopyMediaGroup:
|
|||
message_id: int,
|
||||
captions: Union[List[str], str] = None,
|
||||
disable_notification: bool = None,
|
||||
message_thread_id: int = None,
|
||||
reply_to_message_id: int = None,
|
||||
schedule_date: datetime = None,
|
||||
) -> List["types.Message"]:
|
||||
|
|
@ -65,6 +66,10 @@ class CopyMediaGroup:
|
|||
Sends the message silently.
|
||||
Users will receive a notification with no sound.
|
||||
|
||||
message_thread_id (``int``, *optional*):
|
||||
Unique identifier for the target message thread (topic) of the forum.
|
||||
for forum supergroups only.
|
||||
|
||||
reply_to_message_id (``int``, *optional*):
|
||||
If the message is a reply, ID of the original message.
|
||||
|
||||
|
|
@ -89,6 +94,20 @@ class CopyMediaGroup:
|
|||
media_group = await self.get_media_group(from_chat_id, message_id)
|
||||
multi_media = []
|
||||
|
||||
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)
|
||||
|
||||
for i, message in enumerate(media_group):
|
||||
if message.photo:
|
||||
file_id = message.photo.file_id
|
||||
|
|
@ -119,7 +138,7 @@ class CopyMediaGroup:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
multi_media=multi_media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id,
|
||||
reply_to=reply_to,
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date)
|
||||
),
|
||||
sleep_threshold=60
|
||||
|
|
|
|||
|
|
@ -113,13 +113,27 @@ class CopyMessage:
|
|||
"""
|
||||
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(
|
||||
chat_id=chat_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
disable_notification=disable_notification,
|
||||
reply_to_message_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
schedule_date=schedule_date,
|
||||
protect_content=protect_content,
|
||||
reply_markup=reply_markup
|
||||
|
|
|
|||
|
|
@ -180,6 +180,20 @@ class SendAnimation:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(animation, str):
|
||||
if os.path.isfile(animation):
|
||||
|
|
@ -235,7 +249,7 @@ class SendAnimation:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -174,6 +174,20 @@ class SendAudio:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(audio, str):
|
||||
if os.path.isfile(audio):
|
||||
|
|
@ -222,7 +236,7 @@ class SendAudio:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -103,12 +103,26 @@ class SendCachedMedia:
|
|||
await app.send_cached_media("me", file_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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
media=utils.get_input_media_from_file_id(file_id),
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -95,6 +95,21 @@ class SendContact:
|
|||
|
||||
await app.send_contact("me", "+1-123-456-7890", "Name")
|
||||
"""
|
||||
|
||||
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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
@ -106,7 +121,7 @@ class SendContact:
|
|||
),
|
||||
message="",
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -95,12 +95,26 @@ class SendDice:
|
|||
await app.send_dice(chat_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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
media=raw.types.InputMediaDice(emoticon=emoji),
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -161,6 +161,20 @@ class SendDocument:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(document, str):
|
||||
if os.path.isfile(document):
|
||||
|
|
@ -200,7 +214,7 @@ class SendDocument:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -87,6 +87,21 @@ class SendLocation:
|
|||
|
||||
app.send_location("me", latitude, longitude)
|
||||
"""
|
||||
|
||||
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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
@ -98,7 +113,7 @@ class SendLocation:
|
|||
),
|
||||
message="",
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -99,6 +99,20 @@ class SendMediaGroup:
|
|||
"""
|
||||
multi_media = []
|
||||
|
||||
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)
|
||||
|
||||
for i in media:
|
||||
if isinstance(i, types.InputMediaPhoto):
|
||||
if isinstance(i.media, str):
|
||||
|
|
@ -412,7 +426,7 @@ class SendMediaGroup:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
multi_media=multi_media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content
|
||||
),
|
||||
|
|
|
|||
|
|
@ -128,12 +128,26 @@ class SendMessage:
|
|||
|
||||
message, entities = (await utils.parse_text_entities(self, text, parse_mode, entities)).values()
|
||||
|
||||
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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMessage(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
no_webpage=disable_web_page_preview or None,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
reply_markup=await reply_markup.write(self) if reply_markup else None,
|
||||
|
|
|
|||
|
|
@ -152,6 +152,20 @@ class SendPhoto:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(photo, str):
|
||||
if os.path.isfile(photo):
|
||||
|
|
@ -184,7 +198,7 @@ class SendPhoto:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -138,6 +138,20 @@ class SendPoll:
|
|||
await app.send_poll(chat_id, "Is this a poll question?", ["Yes", "No", "Maybe"])
|
||||
"""
|
||||
|
||||
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)
|
||||
|
||||
solution, solution_entities = (await utils.parse_text_entities(
|
||||
self, explanation, explanation_parse_mode, explanation_entities
|
||||
)).values()
|
||||
|
|
@ -166,7 +180,7 @@ class SendPoll:
|
|||
),
|
||||
message="",
|
||||
silent=disable_notification,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -125,6 +125,20 @@ class SendSticker:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(sticker, str):
|
||||
if os.path.isfile(sticker):
|
||||
|
|
@ -159,7 +173,7 @@ class SendSticker:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,21 @@ class SendVenue:
|
|||
"me", latitude, longitude,
|
||||
"Venue title", "Venue address")
|
||||
"""
|
||||
|
||||
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)
|
||||
|
||||
r = await self.invoke(
|
||||
raw.functions.messages.SendMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
@ -122,7 +137,7 @@ class SendVenue:
|
|||
),
|
||||
message="",
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -185,6 +185,20 @@ class SendVideo:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(video, str):
|
||||
if os.path.isfile(video):
|
||||
|
|
@ -241,7 +255,7 @@ class SendVideo:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -139,6 +139,20 @@ class SendVideoNote:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(video_note, str):
|
||||
if os.path.isfile(video_note):
|
||||
|
|
@ -183,7 +197,7 @@ class SendVideoNote:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
|
|
@ -144,6 +144,20 @@ class SendVoice:
|
|||
"""
|
||||
file = None
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
if isinstance(voice, str):
|
||||
if os.path.isfile(voice):
|
||||
|
|
@ -184,7 +198,7 @@ class SendVoice:
|
|||
peer=await self.resolve_peer(chat_id),
|
||||
media=media,
|
||||
silent=disable_notification or None,
|
||||
reply_to_msg_id=reply_to_message_id or message_thread_id,
|
||||
reply_to=reply_to,
|
||||
random_id=self.rnd_id(),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
|
|
|
|||
Loading…
Reference in a new issue