From e0f547a05db83fd234f10c95ab63eaa5a67fb668 Mon Sep 17 00:00:00 2001 From: Howl Date: Sat, 28 May 2016 22:33:05 +0200 Subject: [PATCH] update tillerinoLast to use userid --- constants/fokabotCommands.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/constants/fokabotCommands.py b/constants/fokabotCommands.py index 2320245..3611dd5 100644 --- a/constants/fokabotCommands.py +++ b/constants/fokabotCommands.py @@ -462,15 +462,16 @@ def tillerinoAcc(fro, chan, message): def tillerinoLast(fro, chan, message): try: - data = glob.db.fetch("""SELECT beatmaps.song_name as sn, scores.username, scores.pp + data = glob.db.fetch("""SELECT beatmaps.song_name as sn, scores.pp FROM scores LEFT JOIN beatmaps ON beatmaps.beatmap_md5=scores.beatmap_md5 - WHERE username = ? + LEFT JOIN users ON users.id = scores.userid + WHERE users.username = ? ORDER BY scores.time DESC LIMIT 1""", [fro]) if data == None: return False - return "{0:.2f}pp ({1} on {2})".format(data["pp"], data["username"], data["sn"]) + return "{0:.2f}pp ({1} on {2})".format(data["pp"], fro, data["sn"]) except Exception as a: print(a) return False