diff options
author | Dmitrii Morozov <snoopdesigns@gmail.com> | 2024-06-21 21:56:40 +0200 |
---|---|---|
committer | Dmitrii Morozov <snoopdesigns@gmail.com> | 2024-06-21 21:56:40 +0200 |
commit | e30cf0345f0e2983b1c9324285dafd4724c0583f (patch) | |
tree | 78749047c1335cd2ae5d3643948dd62b2943c1e3 /telegram_bot | |
parent | 6d4133a04d79b3313c352e536788333af491d4f8 (diff) |
Fixed stats calculation
Diffstat (limited to 'telegram_bot')
-rw-r--r-- | telegram_bot/commands.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/telegram_bot/commands.py b/telegram_bot/commands.py index a1a2888..108f550 100644 --- a/telegram_bot/commands.py +++ b/telegram_bot/commands.py @@ -1,5 +1,5 @@ import telebot -from datetime import date, datetime +import datetime from telegram_bot import * from formatter import * from persistence import * @@ -82,8 +82,8 @@ class GetStatsCallbackQueryHandler(CallbackQueryHandler): await self.__telegram_bot.reply(message, format_user_stats_list(stats)) async def reply_with_stats_days_difference(self, message, days: int, timeframe_alias: str): - stats_date = date.today() - datetime.timedelta(days) - persisted_stats = self.__stats_repository.get_stats(stats_date) + stats_datetime = datetime.datetime.now() - datetime.timedelta(days = days) + persisted_stats = self.__stats_repository.get_stats(stats_datetime) if len(persisted_stats) > 0: friends = await self.__fortnite_client.get_friends() current_stats = [await friend.fetch_stats() for friend in friends] |