Añadir que el script se detenga el martes
This commit is contained in:
@@ -10,6 +10,7 @@ from telegram.ext import (
|
||||
import json
|
||||
import datetime
|
||||
import pytz
|
||||
import sys
|
||||
|
||||
# Define la zona horaria
|
||||
TIMEZONE = pytz.timezone("Europe/Madrid")
|
||||
@@ -120,6 +121,12 @@ def next_monday():
|
||||
|
||||
# Función principal para iniciar el bot
|
||||
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
|
||||
application = ApplicationBuilder().token("1859561736:AAESVsdzTXmO8GjbifI4GihIQZuGqA3tNuk").build()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user