06-sep: [menu] cancelar reabre el menu + traza de edits fallidos
This commit is contained in:
@@ -340,13 +340,16 @@ def teclado_cancelar():
|
|||||||
def _enviar_edit(chat_id, message_id, texto, teclado):
|
def _enviar_edit(chat_id, message_id, texto, teclado):
|
||||||
import requests
|
import requests
|
||||||
try:
|
try:
|
||||||
requests.post(_api("editMessageText"), data={
|
r = requests.post(_api("editMessageText"), data={
|
||||||
"chat_id": chat_id,
|
"chat_id": chat_id,
|
||||||
"message_id": message_id,
|
"message_id": message_id,
|
||||||
"text": texto,
|
"text": texto,
|
||||||
"parse_mode": "HTML",
|
"parse_mode": "HTML",
|
||||||
"reply_markup": json.dumps(teclado),
|
"reply_markup": json.dumps(teclado),
|
||||||
}, timeout=10)
|
}, timeout=10)
|
||||||
|
d = r.json()
|
||||||
|
if not d.get("ok"):
|
||||||
|
_log(f"edit {message_id} fallo: {d.get('description')}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_log(f"edit error: {e}")
|
_log(f"edit error: {e}")
|
||||||
|
|
||||||
@@ -610,6 +613,7 @@ def procesar_callback(data, chat_id, message_id):
|
|||||||
if ruta == "cancelar":
|
if ruta == "cancelar":
|
||||||
_limpiar_pendiente(chat_id)
|
_limpiar_pendiente(chat_id)
|
||||||
_borrar(chat_id, message_id)
|
_borrar(chat_id, message_id)
|
||||||
|
_reenviar_menu(chat_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user