From 7aef5a4c10c55db744dcb1d95488b5e461af0bc2 Mon Sep 17 00:00:00 2001 From: ue86388 Date: Wed, 17 Apr 2024 09:47:40 +0200 Subject: Record stats manually and format todaystats --- tgbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tgbot.py') diff --git a/tgbot.py b/tgbot.py index ba87df7..87d93e1 100755 --- a/tgbot.py +++ b/tgbot.py @@ -89,6 +89,10 @@ async def getTodayStats(message): current_stats = [await friend.fetch_stats() for friend in friends] await reply(message, formatUserStatsDifference(persisted_stats, current_stats)) +@bot.message_handler(commands = ['recordstats']) +async def recordStats(message): + await record_user_stats() + @bot.message_handler(commands = ['find']) async def findUser(message): arg = message.text.split() @@ -150,7 +154,7 @@ async def run_record_stats(): t = time.localtime() if t.tm_hour == 5: # only at 05:00 await record_user_stats() - await asyncio.sleep(60 * 60 * 60) # 1 hour + await asyncio.sleep(60 * 60) # 1 hour async def run_all(): await asyncio.gather(run_tgbot(), run_fortniteStatusWrapper(), run_fortniteClient(), run_record_stats()) -- cgit v1.2.3