diff --git a/stuff.py b/stuff.py index f65d4bb..f9450bb 100755 --- a/stuff.py +++ b/stuff.py @@ -91,19 +91,20 @@ def stuff(bot,sock): cmd=cmd.replace(self_nick, '', 1) command.prefix=self_nick except IndexError: - cmd="none of yer biznez" + continue #skip to next command + cmd="echo IndexError or something" cmd=cmd.strip() - is_adm=line.source in admin_users or line.tags["account"] in admin_accounts + try:is_adm=line.tags["account"] in admin_accounts or line.source in admin_users + except KeyError:is_adm=line.source in admin_users command.line=line command.pm=is_pm command.cmd=cmd command.admin=is_adm command.config=config - if cmd.startswith("echo "): - command.exec_cmd("echo") + #handle special commands (requiring extra args 'n stuff) if cmd=="help": command.exec_cmd("help",[prefixes,enabled_commands,admin_commands]) - if cmd.startswith("help "): + elif cmd.startswith("help "): topic=cmd.split(" ",1)[1] command.exec_cmd("help",[prefixes,enabled_commands,admin_commands,topic,self_nick]) elif is_adm and (cmd=="q" or cmd=="quit"): @@ -127,3 +128,8 @@ def stuff(bot,sock): except Exception as e: mesg("Error: "+str(e)) else: mesg("Error: you're not authorized to exec") + + #handle normal commands + + if cmd.startswith("echo "): + command.exec_cmd("echo")