Skip to content

Commit d40b2e5

Browse files
committed
Refactor: use English variable names in river cron
1 parent 248c8fd commit d40b2e5

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

handlers/crons.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,42 +52,42 @@ async def felizdia(context: ContextTypes.DEFAULT_TYPE):
5252
await context.bot.send_message(chat_id=chat_id, text=felizdia_text(today))
5353

5454
async def actualizarPartidos(context: ContextTypes.DEFAULT_TYPE):
55-
hoy = datetime.datetime.now(bsasTz)
56-
mañana = hoy + datetime.timedelta(days=1)
55+
today = datetime.datetime.now(bsasTz)
56+
tomorrow = today + datetime.timedelta(days=1)
5757

58-
if mañana.weekday() >= 5:
58+
if tomorrow.weekday() >= 5:
5959
return
6060

6161
try:
62-
local, partido = river.es_local(mañana)
63-
if not local:
62+
is_local, match = river.es_local(tomorrow)
63+
if not is_local:
6464
return
6565

66-
dias_semana = ["lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"]
67-
nombre_dia = dias_semana[mañana.weekday()]
66+
weekdays = ["lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"]
67+
weekday_name = weekdays[tomorrow.weekday()]
6868

69-
horario = "hora a confirmar" if partido.hora is None else partido.hora.strftime("a las %H:%M")
70-
msg = f"Mañana {nombre_dia} juega River, {horario}\n(contra {partido.equipo_visitante}, {partido.copa})"
69+
time_str = "hora a confirmar" if match.hora is None else match.hora.strftime("a las %H:%M")
70+
msg = f"Mañana {weekday_name} juega River, {time_str}\n(contra {match.equipo_visitante}, {match.copa})"
7171
await context.bot.send_message(chat_id=NOTICIAS_CHATID, text=msg)
7272
except Exception as e:
7373
logger.error(f"Error checking River matches: {e}")
7474

7575
async def actualizarConciertos(context: ContextTypes.DEFAULT_TYPE):
76-
hoy = datetime.datetime.now(bsasTz)
77-
mañana = hoy + datetime.timedelta(days=1)
76+
today = datetime.datetime.now(bsasTz)
77+
tomorrow = today + datetime.timedelta(days=1)
7878

79-
if mañana.weekday() >= 5:
79+
if tomorrow.weekday() >= 5:
8080
return
8181

8282
try:
83-
hay, concierto = conciertos.hay_concierto(mañana)
84-
if not hay:
83+
has_concert, concert = conciertos.hay_concierto(tomorrow)
84+
if not has_concert:
8585
return
8686

87-
dias_semana = ["lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"]
88-
nombre_dia = dias_semana[mañana.weekday()]
87+
weekdays = ["lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"]
88+
weekday_name = weekdays[tomorrow.weekday()]
8989

90-
msg = f"Mañana {nombre_dia} hay un concierto en River\n{concierto.titulo}"
90+
msg = f"Mañana {weekday_name} hay un concierto en River\n{concert.titulo}"
9191
await context.bot.send_message(chat_id=NOTICIAS_CHATID, text=msg)
9292
except Exception as e:
9393
logger.error(f"Error checking concerts: {e}")

0 commit comments

Comments
 (0)