Added error handling
This commit is contained in:
@@ -61,7 +61,11 @@ async def sorteo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
logging.info("Empezando sorteo")
|
logging.info("Empezando sorteo")
|
||||||
frase = update.message.text.split("/sorteo ")[1]
|
try:
|
||||||
|
frase = update.message.text.split("/sorteo ")[1]
|
||||||
|
except:
|
||||||
|
await context.bot.send_message(chat_id=update.effective_chat.id, text="Error al arrancar el sorteo, asegúrate de poner la frase.")
|
||||||
|
return
|
||||||
global SORTEO_ACTIVO
|
global SORTEO_ACTIVO
|
||||||
# Empezamos a leer mensajes
|
# Empezamos a leer mensajes
|
||||||
SORTEO_ACTIVO = True
|
SORTEO_ACTIVO = True
|
||||||
|
|||||||
Reference in New Issue
Block a user