This commit is contained in:
Luke Rogers 2014-02-21 14:55:33 +13:00
parent 2d90288856
commit 87b1d3d7f4
6 changed files with 21 additions and 13 deletions

View file

@ -25,8 +25,8 @@ def lastfm(inp, nick='', db=None, bot=None, notice=None):
db.execute("create table if not exists lastfm(nick primary key, acc)")
if not user:
user = db.execute("select acc from lastfm where nick=lower(?)",
(nick,)).fetchone()
user = db.execute("select acc from lastfm where nick=lower(:nick)",
{'nick': nick}).fetchone()
if not user:
notice(lastfm.__doc__)
return
@ -76,8 +76,8 @@ def lastfm(inp, nick='', db=None, bot=None, notice=None):
out += ending
if inp and not dontsave:
db.execute("insert or replace into lastfm(nick, acc) values (?,?)",
(nick.lower(), user))
db.execute("insert or replace into lastfm(nick, acc) values "
"(:nick, :account)", {'nick': nick.lower(), 'account': user})
db.commit()
return out