When editing message, make each message reply to the previous
This commit is contained in:
parent
c331313f85
commit
568694f3aa
@ -7,7 +7,7 @@ __author__ = "Davide Testa"
|
|||||||
__email__ = "davide@davte.it"
|
__email__ = "davide@davte.it"
|
||||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||||
__license__ = "GNU General Public License v3.0"
|
__license__ = "GNU General Public License v3.0"
|
||||||
__version__ = "2.1.5"
|
__version__ = "2.1.6"
|
||||||
__maintainer__ = "Davide Testa"
|
__maintainer__ = "Davide Testa"
|
||||||
__contact__ = "t.me/davte"
|
__contact__ = "t.me/davte"
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ class Bot(TelegramBot, ObjectWithDatabase):
|
|||||||
message_id = message_identifier['message_id']
|
message_id = message_identifier['message_id']
|
||||||
if 'inline_message_id' in message_identifier:
|
if 'inline_message_id' in message_identifier:
|
||||||
inline_message_id = message_identifier['inline_message_id']
|
inline_message_id = message_identifier['inline_message_id']
|
||||||
for i, text_chunk in enumerate(
|
for i, (text_chunk, is_last) in enumerate(
|
||||||
self.split_message_text(
|
self.split_message_text(
|
||||||
text=text,
|
text=text,
|
||||||
limit=self.__class__.TELEGRAM_MESSAGES_MAX_LEN - 200,
|
limit=self.__class__.TELEGRAM_MESSAGES_MAX_LEN - 200,
|
||||||
@ -995,16 +995,19 @@ class Bot(TelegramBot, ObjectWithDatabase):
|
|||||||
# Inline keyboards attached to inline query results may be
|
# Inline keyboards attached to inline query results may be
|
||||||
# in chats the bot cannot reach.
|
# in chats the bot cannot reach.
|
||||||
break
|
break
|
||||||
|
updates = [update]
|
||||||
else:
|
else:
|
||||||
await self.send_message(
|
updates.append(
|
||||||
text=text_chunk,
|
await self.send_message(
|
||||||
chat_id=chat_id,
|
text=text_chunk,
|
||||||
parse_mode=parse_mode,
|
chat_id=chat_id,
|
||||||
disable_web_page_preview=disable_web_page_preview,
|
parse_mode=parse_mode,
|
||||||
reply_markup=reply_markup,
|
disable_web_page_preview=disable_web_page_preview,
|
||||||
update=update,
|
reply_markup=(reply_markup if is_last else None),
|
||||||
reply_to_update=True,
|
update=updates[-1],
|
||||||
send_default_keyboard=False
|
reply_to_update=True,
|
||||||
|
send_default_keyboard=False
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return edited_message
|
return edited_message
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user