We need to await!

This commit is contained in:
Joan
2023-11-09 18:58:01 +01:00
parent 199885d9f0
commit 83bc0038b1

View File

@@ -498,7 +498,7 @@ async def show_conjunta_details(update: Update, context: CallbackContext):
async def send_message_to_admins(update: Update, context: CallbackContext, message): async def send_message_to_admins(update: Update, context: CallbackContext, message):
for admin_id in admin_ids: for admin_id in admin_ids:
try: try:
context.bot.send_message(chat_id=admin_id, text=message, parse_mode=ParseMode.HTML) await context.bot.send_message(chat_id=admin_id, text=message, parse_mode=ParseMode.HTML)
except Exception as e: except Exception as e:
logging.error(f"Error sending message: {e}") logging.error(f"Error sending message: {e}")
@@ -530,7 +530,7 @@ def main()->None:
# Avisamos de que el bot está en funcionamiento # Avisamos de que el bot está en funcionamiento
for admin_id in admin_ids: for admin_id in admin_ids:
try: try:
application.bot.send_message(chat_id=admin_id, text="El bot acaba de arrancar y está en funcionamiento.") await application.bot.send_message(chat_id=admin_id, text="El bot acaba de arrancar y está en funcionamiento.")
except Exception as e: except Exception as e:
logging.error(f"Error sending message: {e}") logging.error(f"Error sending message: {e}")