Añadir que el script se detenga el martes

This commit is contained in:
2025-03-10 07:35:04 +01:00
parent e011ba6a8e
commit 2bc50b4320
2 changed files with 8 additions and 1 deletions
Submodule python-utilities updated: db4441c4d5...e011ba6a8e
+7
View File
@@ -10,6 +10,7 @@ from telegram.ext import (
import json import json
import datetime import datetime
import pytz import pytz
import sys
# Define la zona horaria # Define la zona horaria
TIMEZONE = pytz.timezone("Europe/Madrid") TIMEZONE = pytz.timezone("Europe/Madrid")
@@ -120,6 +121,12 @@ def next_monday():
# Función principal para iniciar el bot # Función principal para iniciar el bot
def main(): def main():
# si ya es martes, paramos la ejecución del bot hasta el lunes que viene:
# Obtener la fecha actual
hoy = datetime.datetime.now(TIMEZONE)
if hoy == 1:
sys.exit()
# El token del bot # El token del bot
application = ApplicationBuilder().token("1859561736:AAESVsdzTXmO8GjbifI4GihIQZuGqA3tNuk").build() application = ApplicationBuilder().token("1859561736:AAESVsdzTXmO8GjbifI4GihIQZuGqA3tNuk").build()