We need to await!
This commit is contained in:
@@ -498,7 +498,7 @@ async def show_conjunta_details(update: Update, context: CallbackContext):
|
||||
async def send_message_to_admins(update: Update, context: CallbackContext, message):
|
||||
for admin_id in admin_ids:
|
||||
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:
|
||||
logging.error(f"Error sending message: {e}")
|
||||
|
||||
@@ -530,7 +530,7 @@ def main()->None:
|
||||
# Avisamos de que el bot está en funcionamiento
|
||||
for admin_id in admin_ids:
|
||||
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:
|
||||
logging.error(f"Error sending message: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user