plugins/seen: don't use LIKE (SQL wildcards confuse people), compare lowercase nicks instead
This commit is contained in:
parent
e0518f6c2a
commit
80548ca8f9
|
@ -26,17 +26,19 @@ def seeninput(paraml, input=None, db=None, bot=None):
|
||||||
def seen(inp, nick='', chan='', db=None, input=None):
|
def seen(inp, nick='', chan='', db=None, input=None):
|
||||||
".seen <nick> -- Tell when a nickname was last in active in irc"
|
".seen <nick> -- Tell when a nickname was last in active in irc"
|
||||||
|
|
||||||
if input.conn.nick.lower() == inp.lower():
|
inp = inp.lower()
|
||||||
|
|
||||||
|
if input.conn.nick.lower() == inp:
|
||||||
# user is looking for us, being a smartass
|
# user is looking for us, being a smartass
|
||||||
return "You need to get your eyes checked."
|
return "You need to get your eyes checked."
|
||||||
|
|
||||||
if inp.lower() == nick.lower():
|
if inp == nick.lower():
|
||||||
return "Have you looked in a mirror lately?"
|
return "Have you looked in a mirror lately?"
|
||||||
|
|
||||||
db_init(db)
|
db_init(db)
|
||||||
|
|
||||||
last_seen = db.execute("select name, time, quote from seen where name"
|
last_seen = db.execute("select name, time, quote from seen where"
|
||||||
" like ? and chan = ?", (inp, chan)).fetchone()
|
" name = ? and chan = ?", (inp, chan)).fetchone()
|
||||||
|
|
||||||
if last_seen:
|
if last_seen:
|
||||||
reltime = timesince.timesince(last_seen[1])
|
reltime = timesince.timesince(last_seen[1])
|
||||||
|
|
Loading…
Reference in New Issue