make events take param lists intead of param strings

This commit is contained in:
Ryan Hitchman 2010-03-11 17:28:17 -07:00
parent 24a837c606
commit b69bd212a3
5 changed files with 9 additions and 9 deletions

View File

@ -36,8 +36,9 @@ class Input(dict):
def run(func, input):
args = func._args
if 'inp' not in input:
input.inp = input.params
input.inp = input.paraml
if args:
if 'db' in args:

View File

@ -85,7 +85,7 @@ def get_log_fd(dir, server, chan):
@hook.thread
@hook.event('*')
def log(inp, input=None, bot=None):
def log(paraml, input=None, bot=None):
with lock:
timestamp = gmtime(timestamp_format)

View File

@ -8,7 +8,7 @@ socket.setdefaulttimeout(10) # global setting
#autorejoin channels
@hook.event('KICK')
def rejoin(inp, paraml=[], conn=None):
def rejoin(paraml, conn=None):
if paraml[1] == conn.nick:
if paraml[0].lower() in conn.channels:
conn.join(paraml[0])
@ -16,14 +16,13 @@ def rejoin(inp, paraml=[], conn=None):
#join channels when invited
@hook.event('INVITE')
def invite(inp, command='', conn=None):
if command == 'INVITE':
conn.join(inp)
def invite(paraml, conn=None):
conn.join(paraml[-1])
#join channels when server says hello & identify bot
@hook.event('004')
def onjoin(inp, conn=None):
def onjoin(paraml, conn=None):
nickserv_password = conn.conf.get('nickserv_password', '')
nickserv_name = conn.conf.get('nickserv_name', 'nickserv')
nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY %s')

View File

@ -7,7 +7,7 @@ from util import hook, timesince
@hook.thread
@hook.event('PRIVMSG')
def seeninput(inp, input=None, bot=None):
def seeninput(paraml, input=None, bot=None):
db = bot.get_db_connection(input.server)
db_init(db)
db.execute("insert or replace into seen(name, time, quote, chan)"

View File

@ -14,7 +14,7 @@ def get_tells(db, user_to, chan):
@hook.thread
@hook.event('PRIVMSG')
def tellinput(inp, input=None, bot=None):
def tellinput(paraml, input=None, bot=None):
if 'showtells' in input.msg.lower():
return