From 9eafa55dd80025b833b86248ab036c24a06ec8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lia=20Sch=C3=B6newei=C3=9F?= Date: Tue, 2 Jan 2024 21:50:15 +0100 Subject: [PATCH] fix date check --- bot/commands/advent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/commands/advent.py b/bot/commands/advent.py index 30c593e..189c1cc 100644 --- a/bot/commands/advent.py +++ b/bot/commands/advent.py @@ -125,8 +125,8 @@ class AdventsHandler(BaseHandler): reply_markup = InlineKeyboardMarkup(keyboard) - #if tuer_nummer <= int(date.today().strftime("%d")): - if (tuer_nummer <= int(date.today().strftime("%d"))) and (int(date.today().strftime("%m"))==12): + datum_tuer_heute = date(2023, 12, tuer_nummer) + if (date.today() - datum_tuer_heute).days >= 0: await update.message.reply_document(document=GIF_LOCATION/ f"gif{tuer_nummer}.mp4", caption=f"Türchen für den {tuer_nummer}. Dezember: \n" + self.tuerchen_texte[tuerchen], reply_markup=reply_markup) else: await update.message.reply_sticker(sticker=STICKER_LOCATION/"stickerangry.tgs")