Added error handling
This commit is contained in:
@@ -61,7 +61,11 @@ async def sorteo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
return
|
||||
|
||||
logging.info("Empezando sorteo")
|
||||
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
|
||||
# Empezamos a leer mensajes
|
||||
SORTEO_ACTIVO = True
|
||||
|
||||
Reference in New Issue
Block a user