Skip to content

Commit

Permalink
Merge pull request #325 from C-Pro/feature/upd-tree-year
Browse files Browse the repository at this point in the history
update tree year
  • Loading branch information
C-Pro authored Nov 24, 2024
2 parents b408b74 + 426ba82 commit 8db9880
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 5 additions & 3 deletions bot/skills/kozula.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ def _get_usd_rate() -> Optional[float]:
def kozula(update: Update, context: CallbackContext):
usd_rate = _get_usd_rate()
kozula_rates = [
f"{round(KOZULA_RATE_USD * usd_rate, 2)}₽"
if usd_rate is not None
else "курс ₽ недоступен",
(
f"{round(KOZULA_RATE_USD * usd_rate, 2)}₽"
if usd_rate is not None
else "курс ₽ недоступен"
),
f"${KOZULA_RATE_USD}",
]

Expand Down
3 changes: 2 additions & 1 deletion bot/skills/still.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ def still(update: Update, context: CallbackContext):

if text:
context.bot.send_message(
chat_id, f"Вот бы сейчас {text} в {to_2k_year(datetime.now().year)} лул 😹😹😹"
chat_id,
f"Вот бы сейчас {text} в {to_2k_year(datetime.now().year)} лул 😹😹😹",
)
11 changes: 10 additions & 1 deletion bot/skills/tree.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import logging

from datetime import datetime

from telegram import Update
from telegram.ext import Updater, CallbackContext

from handlers import ChatCommandHandler

logger = logging.getLogger(__name__)

AOC_LEADERBOARD_LINK = "https://adventofcode.com/2023/leaderboard/private/view/458538"
now = datetime.now()
year = now.year
if now.month < 12:
year -= 1

AOC_LEADERBOARD_LINK = (
f"https://adventofcode.com/{year}/leaderboard/private/view/458538"
)


def add_tree(upd: Updater, handlers_group: int):
Expand Down

0 comments on commit 8db9880

Please sign in to comment.