Telethon jedoch nicht Geben Sie den aktualisierten Text automatisch aus der Rückrufantwort zurück, aber stattdessen werden immer dieselbe erste Nachricht zurückgegeben. < /p>
`< /p>
Code: Select all
while True:
try:
# Wait for the next response. Use a short timeout (e.g. 3s)
msg = await conv.get_response(timeout=3)
#print(msg.stringify())
# Append the message text (or the entire Message object if you want)
all_bot_replies.append(msg.text)
print(msg.text)
"""
if msg.reply_markup is not None:
for row in msg.reply_markup.rows:
if len(row.buttons) > 2:
button = row.buttons[2]
#print(msg.stringify())
# Click the button
await msg.click(2)
await msg.click(2)
update_event = await conv.wait_event(events.MessageEdited)
print("quaaaaaaaaaaa", update_event)
"""
try:
for row in msg.reply_markup.rows:
button = []
button.append(row.buttons)
try:
if button[0][2]:
btn = button[0][2]
page = button[0][1].text[0]
finalpage = button[0][1].text[-1]
callback_data = btn.data
for i in range(int(page), int(finalpage)+1):
print("stom qua")
# con la callback clicco il bottone
await client(GetBotCallbackAnswerRequest(
peer=msg.chat.id,
msg_id=msg.id,
data=callback_data
))
except IndexError:
pass
except AttributeError:
pass
except asyncio.TimeoutError:
# No more messages arrived in 3 seconds -> done
break
# Store the list of replies for this email
results[email] = all_bot_replies`