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: