From bd78016c31e2ff9cb280288a5377e4eaf45dbec0 Mon Sep 17 00:00:00 2001 From: Compu Date: Sat, 19 Mar 2016 01:08:45 -0400 Subject: [PATCH] fixed a bug in .seen related to uppercase and lowercase variations on nicks --- modules/seen.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/seen.py b/modules/seen.py index 1928c1c96..5a0d73308 100644 --- a/modules/seen.py +++ b/modules/seen.py @@ -56,7 +56,7 @@ def seen(phenny, input): conn = db_connect(seen_db) c = conn.cursor() query = (inputnick,) - c.execute("SELECT * FROM seen WHERE nick LIKE ?;", query) + c.execute("SELECT * FROM seen WHERE nick LIKE ? COLLATE NOCASE ORDER BY time DESC LIMIT 1;", query) resultsun = c.fetchall() gotresults = True else: @@ -78,9 +78,9 @@ def seen(phenny, input): phenny.say ("\x01ACTION pokes " + input.nick + "\x01") phenny.say("Are you broken?") phenny.say("I need a nick for that command") - elif input.nick == inputnick: + elif input.nick.upper().lower() == inputnick.upper().lower(): phenny.say("Silly, that's you!") - elif inputnick == phenny.nick: + elif inputnick.upper().lower() == phenny.nick.upper().lower(): phenny.say("Silly, that's me!") elif not nick: phenny.say("Sorry I haven't seen " + inputnick)