1
0
forked from sass/tipibot

Change exp leveling system

This commit is contained in:
Rene Arumetsa
2026-05-13 22:43:34 +03:00
parent 15e3121d55
commit 8d7ac504ca
3 changed files with 45 additions and 16 deletions

View File

@@ -9,7 +9,7 @@ from discord import app_commands
from core import sheets
import strings as S
from core.member_sync import announce_birthday, sync_member
from core.member_sync import announce_birthday, sync_member, today_local
class BirthdayPages(discord.ui.View):
@@ -44,7 +44,7 @@ def _build_birthday_pages(
Returns (pages, start_index) where start_index is the current month.
"""
rows = sheets.get_cache()
today = datetime.date.today()
today = today_local()
by_month: dict[int, list[tuple[int, str, int | None]]] = {m: [] for m in range(1, 13)}
@@ -298,8 +298,8 @@ def register_dev_member_commands(
for fmt in ["%d/%m/%Y", "%Y-%m-%d"]:
try:
bday = datetime.datetime.strptime(bday_str, fmt).date()
if 1920 <= bday.year <= datetime.date.today().year:
today = datetime.date.today()
if 1920 <= bday.year <= today_local().year:
today = today_local()
age = today.year - bday.year - ((today.month, today.day) < (bday.month, bday.day))
embed.add_field(name=S.MEMBER_UI["age_field"], value=S.MEMBER_UI["age_val"].format(age=age), inline=True)
break