diff --git a/pychan/commands/utilities/aoc.py b/pychan/commands/utilities/aoc.py index 06789fd..71eba78 100644 --- a/pychan/commands/utilities/aoc.py +++ b/pychan/commands/utilities/aoc.py @@ -34,7 +34,6 @@ def __init__(self, id: int, local_score: int, global_score, name: str, stars: in self.last_star_ts: int = last_star_ts self.completion: Completion = completion - class TrackedChannel: def __init__(self, leaderboard_id: int, messages: List[Message]) -> None: self.leaderboard_id = leaderboard_id @@ -112,9 +111,6 @@ async def force_update(self, ctx: Context): @tasks.loop(minutes=15) async def loop(self): - # timezone issue :clown: - tomorrow = datetime.combine(date.today(), time(6, 0)) - tomorrow += timedelta(days=1) for _, tracked_channel in self.tracked_channels.items(): data = self.fetch_data(tracked_channel.leaderboard_id) extracted_data = self.parse_data(data) @@ -157,7 +153,12 @@ def get_rows(self, data: List[AoCMember]) -> List[str]: def split_message(self, rows: List[str]) -> List[str]: messages = [] - current_message = '```\n' + tomorrow = datetime.combine(date.today(), time(6, 0)) + tomorrow += timedelta(days=1) + current_message = f'# AoC {datetime.today().year} Leaderboard\n \ + Ostatnia aktualizacja: \n \ + Czas do następnego wyzwania: \ + ```\n' for row in rows: if len(current_message) + len(row) + 4 > 2000: # 4 for closing ``` current_message += '```'