From 5a5ec1f3204b714d0aaf708b779f7c16f5dfe205 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 30 Jan 2016 16:56:15 +0100 Subject: [PATCH] Vedi comment --- bot.py | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 2ddf5987..9e66593e 100644 --- a/bot.py +++ b/bot.py @@ -352,9 +352,70 @@ while True: "*50*: " + r['count50'] + "\n" "*Miss*: " + r['countmiss'], sentin, source) else: - # E' un po' una scorciatoia eh, peeerĂ²... + # TODO: Mettere a posto sto schifo. if username.lower() in osunames: r = osu.getuserrecent(osunames[username.lower()], 0) + if "enabled_mods" in r: + mods = "*Mod:*" + # Adoro SE + # Dividi in bit l'ID delle mod selezionate + if int(r['enabled_mods']) & 0b1: + mods += " NoFail" + if int(r['enabled_mods']) & 0b10: + mods += " Easy" + if int(r['enabled_mods']) & 0b100: + mods += " NoVideo (?)" + if int(r['enabled_mods']) & 0b1000: + mods += " Hidden" + if int(r['enabled_mods']) & 0b10000: + mods += " HardRock" + if int(r['enabled_mods']) & 0b100000: + mods += " SuddenDeath" + if int(r['enabled_mods']) & 0b1000000: + mods += " DoubleTime" + if int(r['enabled_mods']) & 0b10000000: + mods += " Relax" + if int(r['enabled_mods']) & 0b100000000: + mods += " HalfTime" + if int(r['enabled_mods']) & 0b1000000000: + mods += " Nightcore" + if int(r['enabled_mods']) & 0b10000000000: + mods += " Flashlight" + if int(r['enabled_mods']) & 0b100000000000: + mods += " Autoplay" + if int(r['enabled_mods']) & 0b1000000000000: + mods += " SpunOut" + if int(r['enabled_mods']) & 0b10000000000000: + mods += " Autopilot" + if int(r['enabled_mods']) & 0b100000000000000: + mods += " Perfect" + if int(r['enabled_mods']) & 0b1000000000000000: + mods += " 4K" + if int(r['enabled_mods']) & 0b10000000000000000: + mods += " 5K" + if int(r['enabled_mods']) & 0b100000000000000000: + mods += " 6K" + if int(r['enabled_mods']) & 0b1000000000000000000: + mods += " 7K" + if int(r['enabled_mods']) & 0b10000000000000000000: + mods += " 8K" + if int(r['enabled_mods']) & 0b100000000000000000000: + mods += " FadeIn" + if int(r['enabled_mods']) & 0b1000000000000000000000: + mods += " Random" + if int(r['enabled_mods']) & 0b1000000000000000000000000: + mods += " 9K" + if int(r['enabled_mods']) & 0b10000000000000000000000000: + mods += " 10K" + if int(r['enabled_mods']) & 0b100000000000000000000000000: + mods += " 1K" + if int(r['enabled_mods']) & 0b1000000000000000000000000000: + mods += " 3K" + if int(r['enabled_mods']) & 0b10000000000000000000000000000: + mods += " 2K" + mods += '\n' + else: + mods = '\n' telegram.sendmessage("*Osu!*\n" "[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r[ 'beatmap_id'] +