From b3326e0fe9701b24430971db7fed22ba1e3dce6d Mon Sep 17 00:00:00 2001 From: neersighted Date: Tue, 28 Feb 2012 08:17:18 +0800 Subject: [PATCH] fixed lastfm for default user --- plugins/lastfm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/lastfm.py b/plugins/lastfm.py index f2a4eff..5bb921b 100644 --- a/plugins/lastfm.py +++ b/plugins/lastfm.py @@ -1,7 +1,13 @@ from util import hook, http +@hook.command('l') +@hook.command('lfm') @hook.command def lastfm(inp, nick='', say=None, db=None, bot=None): + if inp: + user = inp + else: + user = nick ".lastfm - display the now playing (or recent) tracks of a LastFM user" db.execute("create table if not exists lastfm(nick primary key, acc)") sql = db.execute("select acc from lastfm where nick=lower(?)", (nick,)).fetchone(); @@ -10,7 +16,6 @@ def lastfm(inp, nick='', say=None, db=None, bot=None): if api_key is None: return "error: no api key set" - if sql: if not inp: user = sql[0] else: