From 35f9daf662c3cf4f2e044c2a619f3e74e5e62528 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 16 Nov 2015 22:59:19 +0100 Subject: [PATCH] Bugfix --- bot.py | 4 ++-- osu.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index e70c5bac..7218319f 100644 --- a/bot.py +++ b/bot.py @@ -64,8 +64,8 @@ while True: telegram.senddocument('BQADAgADTQIAAh8GgAGj0jKIrpTgvQI', sby) elif cmd[0].startswith('/osunow'): print(str(sby) + ": /osunow ") - if cmd[1] is not None: - if cmd[2] is not None: + if len(cmd) >= 2: + if len(cmd) >= 3: r = osu.getuserrecent(cmd[1], cmd[2]) else: r = osu.getuserrecent(cmd[1]) diff --git a/osu.py b/osu.py index f53e69d1..e1f635d1 100644 --- a/osu.py +++ b/osu.py @@ -72,4 +72,4 @@ def getuserrecent(user, mode=0): 'm': mode, } r = requests.get("https://osu.ppy.sh/api/get_user_recent", params=parametri).json() - return r[0] + return r