make events take param lists intead of param strings
This commit is contained in:
parent
24a837c606
commit
b69bd212a3
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue