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