Fixes
This commit is contained in:
@@ -284,10 +284,11 @@ async def update_conjunta(update: Update, context: CallbackContext, conjunta_id)
|
||||
|
||||
# Función para unirse a una conjunta
|
||||
async def handle_conjunta(update: Update, context: CallbackContext):
|
||||
try:
|
||||
user_id = update.effective_user.id
|
||||
user_name = update.effective_user.username
|
||||
reply_message_id = update.message.reply_to_message.message_id
|
||||
message = update.message.text
|
||||
reply_message_id = update.message.reply_to_message.message_id
|
||||
|
||||
cursor.execute("SELECT * FROM conjuntas WHERE message_id=?", (reply_message_id,))
|
||||
conjunta = cursor.fetchone()
|
||||
@@ -369,6 +370,8 @@ async def handle_conjunta(update: Update, context: CallbackContext):
|
||||
await update.message.reply_text("Por favor, introduce una cantidad válida.")
|
||||
else:
|
||||
await update.message.reply_text("La conjunta ya está cerrada y no puedes unirte.")
|
||||
except Exception as e:
|
||||
logging.error(f"Error handling message: {e}")
|
||||
|
||||
async def close_conjunta(update: Update, context: CallbackContext):
|
||||
user_id = update.effective_user.id
|
||||
@@ -527,13 +530,6 @@ def main()->None:
|
||||
application.add_handler(CallbackQueryHandler(close_conjunta, pattern="close \d"))
|
||||
application.add_handler(MessageHandler(filters.REPLY, handle_conjunta))
|
||||
|
||||
# Avisamos de que el bot está en funcionamiento
|
||||
for admin_id in admin_ids:
|
||||
try:
|
||||
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}")
|
||||
|
||||
application.run_polling()
|
||||
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user