From 7e17bb9220adfcfdac3f489703e006a6db87ce57 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 24 Nov 2015 16:01:50 +0100 Subject: [PATCH] =?UTF-8?q?diviso=20le=204=20modalit=C3=A0=20di=20/osunow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/bot.py b/bot.py index 4bbec0d7..013db3b0 100644 --- a/bot.py +++ b/bot.py @@ -60,7 +60,8 @@ while True: else: telegram.sendmessage(chr(9888) + ' Non hai specificato un gioco!' + - '[Visualizza tutto](https://isthereanydeal.com/#/search:.;/scroll:%23gamelist).', sby) + '[Visualizza tutto](https://isthereanydeal.com/#/search:.;/scroll:%23gamelist).', + sby) elif cmd[0].startswith('/rage'): if len(rage) <= 0: # Elenco degli audio disponibili @@ -89,16 +90,51 @@ while True: if len(cmd) >= 2: cmd = msg['text'].split(' ', 2) if len(cmd) >= 3: - r = osu.getuserrecent(cmd[1], cmd[2]) + mode = int(cmd[2]) else: - r = osu.getuserrecent(cmd[1]) - telegram.sendmessage("[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r['beatmap_id'] + - ")\n*" + r['rank'] + "*\n*Punti*: " + r['score'] + "\n" + - "*Combo* x" + r['maxcombo'] + "\n" + - "*300*: " + r['count300'] + "\n" + - "*100*: " + r['count100'] + "\n" + - "*50*: " + r['count50'] + "\n" + - "*Miss*: " + r['countmiss'], sby) + mode = 0 + r = osu.getuserrecent(cmd[1], mode) + if mode == 0: + telegram.sendmessage("*Osu!*\n" + + "[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r['beatmap_id'] + + ")\n*" + r['rank'] + "*\n*Punti*: " + r['score'] + "\n" + + "*Combo* x" + r['maxcombo'] + "\n" + + "*300*: " + r['count300'] + "\n" + + "*100*: " + r['count100'] + "\n" + + "*50*: " + r['count50'] + "\n" + + "*Awesome*: " + r['countkatu'] + "\n" + + "*Good*: " + r['countgeki'] + "\n" + + "*Miss*: " + r['countmiss'], sby) + elif mode == 1: + telegram.sendmessage("*Taiko*\n" + + "[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r['beatmap_id'] + + ")\n*" + r['rank'] + "*\n*Punti*: " + r['score'] + "\n" + + "*Combo* x" + r['maxcombo'] + "\n" + + "*Great*: " + r['count300'] + "\n" + + "*Good*: " + r['count100'] + "\n" + + "_Large_ *Great*: " + r['countkatu'] + "\n" + + "_Large_ *Good*: " + r['countgeki'] + "\n" + + "*Bad*: " + r['countmiss'], sby) + elif mode == 2: + telegram.sendmessage("*Catch the Beat*\n" + + "[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r['beatmap_id'] + + ")\n*" + r['rank'] + "*\n*Punti*: " + r['score'] + "\n" + + "*Combo* x" + r['maxcombo'] + "\n" + + "*Fruit*: " + r['count300'] + "\n" + + "*Droplet* _tick_: " + r['count100'] + "\n" + + "*Droplet* _trail_: " + r['count50'] + "\n" + + "*Miss*: " + r['countmiss'], sby) + elif mode == 3: + telegram.sendmessage("*Osu!mania*\n" + + "[Beatmap " + r['beatmap_id'] + "](" + 'https://osu.ppy.sh/b/' + r['beatmap_id'] + + ")\n*" + r['rank'] + "*\n*Punti*: " + r['score'] + "\n" + + "*Combo* x" + r['maxcombo'] + "\n" + + "_Rainbow_ *300*: " + r['countgeki'] + "\n" + + "*300*: " + r['count300'] + "\n" + + "*100*: " + r['count100'] + "\n" + + "*200*: " + r['countkatu'] + "\n" + + "*50*: " + r['count50'] + "\n" + + "*Miss*: " + r['countmiss'], sby) else: # In futuro, il nome utente deve trovarlo da solo in base all'username di provenienza. telegram.sendmessage(chr(9888) + " Non hai specificato un nome utente!", sby)