From f88adda08f3dbc7f47e4f0161f8a69ff546dd0b3 Mon Sep 17 00:00:00 2001 From: Gabriel Jaeger Date: Fri, 7 May 2021 16:48:52 +0300 Subject: [PATCH] add rounding to rank difference and remove unnecessary comment. --- locations_handler.py | 4 ++-- telegram_bot.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/locations_handler.py b/locations_handler.py index 61a0378..5607b8c 100644 --- a/locations_handler.py +++ b/locations_handler.py @@ -127,8 +127,8 @@ def build_leaderboard(self, chat_id): if matching_rank_entry == 1: motivation_text = "\U0001F947 You are my favorite DJ at the moment! \U0001F947 \nThank you for your most appreciated support \U0001F618. \n\n" else: - difference_to_above = leaderboard[matching_rank_entry - - 2]["total_distance"] - entry_to_find["total_distance"] + difference_to_above = round(leaderboard[matching_rank_entry - + 2]["total_distance"] - entry_to_find["total_distance"], 2) motivation_text = "The person a rank above you accompanied me by {}km more than you. Let's close that gap and make YOU my top DJ! \U0001F4BF \n\n".format( difference_to_above) if matching_rank_entry > 10: diff --git a/telegram_bot.py b/telegram_bot.py index 2dbee0d..afb94d0 100644 --- a/telegram_bot.py +++ b/telegram_bot.py @@ -96,7 +96,7 @@ def __init__( "p": self.play_pause, "hm": self.provide_unlistened_songs_details, } - # "listen": self.start_listening, + for command in ADMIN_COMMAND_MAP: dispatcher.add_handler( CommandHandler(