From 85a358c08a336067ffd4a3049ba1c8fe16d32f9b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 23 Jan 2019 15:16:50 +0100 Subject: [PATCH] ! --- db.py | 8 ++++---- statsupdate.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/db.py b/db.py index dcab8ac2..d61f3371 100644 --- a/db.py +++ b/db.py @@ -650,10 +650,10 @@ class Osu(Base, Mini): r3.raise_for_status() j3 = r3.json()[0] self.osu_name = j0["username"] - std.value = j0["pp_raw"] - taiko.value = j1["pp_raw"] - catch.value = j2["pp_raw"] - mania.value = j3["pp_raw"] + std.value = float(j0["pp_raw"]) + taiko.value = float(j1["pp_raw"]) + catch.value = float(j2["pp_raw"]) + mania.value = float(j3["pp_raw"]) self.std_pp = std.value self.taiko_pp = taiko.value self.catch_pp = catch.value diff --git a/statsupdate.py b/statsupdate.py index b6526d6f..c4224a82 100644 --- a/statsupdate.py +++ b/statsupdate.py @@ -114,19 +114,19 @@ def osu_pp_change(item, change: typing.Tuple[DirtyDelta, DirtyDelta, DirtyDelta, try: if std.delta >= 1: telegram_bot.send_message(config["Telegram"]["main_group"], - f"✳️ {item.royal.username} ha ora **{std.value}pp** (+{std.delta}) su osu!", + f"✳️ {item.royal.username} ha ora **{int(std.value)}pp** (+{int(std.delta)}) su osu!", parse_mode="Markdown") if taiko.delta >= 1: telegram_bot.send_message(config["Telegram"]["main_group"], - f"✳️ {item.royal.username} ha ora **{taiko.value}pp** (+{taiko.delta}) su osu!taiko!", + f"✳️ {item.royal.username} ha ora **{int(taiko.value)}pp** (+{int(taiko.delta)}) su osu!taiko!", parse_mode="Markdown") if catch.delta >= 1: telegram_bot.send_message(config["Telegram"]["main_group"], - f"✳️ {item.royal.username} ha ora **{catch.value}pp** (+{catch.delta}) su osu!catch!", + f"✳️ {item.royal.username} ha ora **{int(catch.value)}pp** (+{int(catch.delta)}) su osu!catch!", parse_mode="Markdown") if mania.delta >= 1: telegram_bot.send_message(config["Telegram"]["main_group"], - f"✳️ {item.royal.username} ha ora **{mania.value}pp** (+{mania.delta}) su osu!mania!", + f"✳️ {item.royal.username} ha ora **{int(mania.value)}pp** (+{int(mania.delta)}) su osu!mania!", parse_mode="Markdown") except Exception: logger.warning(f"Couldn't notify on Telegram: {item}")