Añadir que el script se detenga el martes
This commit is contained in:
+1
-1
Submodule python-utilities updated: db4441c4d5...e011ba6a8e
@@ -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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user