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):
|
def run(func, input):
|
||||||
args = func._args
|
args = func._args
|
||||||
|
|
||||||
if 'inp' not in input:
|
if 'inp' not in input:
|
||||||
input.inp = input.params
|
input.inp = input.paraml
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
if 'db' in args:
|
if 'db' in args:
|
||||||
|
|
|
@ -85,7 +85,7 @@ def get_log_fd(dir, server, chan):
|
||||||
|
|
||||||
@hook.thread
|
@hook.thread
|
||||||
@hook.event('*')
|
@hook.event('*')
|
||||||
def log(inp, input=None, bot=None):
|
def log(paraml, input=None, bot=None):
|
||||||
with lock:
|
with lock:
|
||||||
timestamp = gmtime(timestamp_format)
|
timestamp = gmtime(timestamp_format)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ socket.setdefaulttimeout(10) # global setting
|
||||||
|
|
||||||
#autorejoin channels
|
#autorejoin channels
|
||||||
@hook.event('KICK')
|
@hook.event('KICK')
|
||||||
def rejoin(inp, paraml=[], conn=None):
|
def rejoin(paraml, conn=None):
|
||||||
if paraml[1] == conn.nick:
|
if paraml[1] == conn.nick:
|
||||||
if paraml[0].lower() in conn.channels:
|
if paraml[0].lower() in conn.channels:
|
||||||
conn.join(paraml[0])
|
conn.join(paraml[0])
|
||||||
|
@ -16,14 +16,13 @@ def rejoin(inp, paraml=[], conn=None):
|
||||||
|
|
||||||
#join channels when invited
|
#join channels when invited
|
||||||
@hook.event('INVITE')
|
@hook.event('INVITE')
|
||||||
def invite(inp, command='', conn=None):
|
def invite(paraml, conn=None):
|
||||||
if command == 'INVITE':
|
conn.join(paraml[-1])
|
||||||
conn.join(inp)
|
|
||||||
|
|
||||||
|
|
||||||
#join channels when server says hello & identify bot
|
#join channels when server says hello & identify bot
|
||||||
@hook.event('004')
|
@hook.event('004')
|
||||||
def onjoin(inp, conn=None):
|
def onjoin(paraml, conn=None):
|
||||||
nickserv_password = conn.conf.get('nickserv_password', '')
|
nickserv_password = conn.conf.get('nickserv_password', '')
|
||||||
nickserv_name = conn.conf.get('nickserv_name', 'nickserv')
|
nickserv_name = conn.conf.get('nickserv_name', 'nickserv')
|
||||||
nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY %s')
|
nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY %s')
|
||||||
|
|
|
@ -7,7 +7,7 @@ from util import hook, timesince
|
||||||
|
|
||||||
@hook.thread
|
@hook.thread
|
||||||
@hook.event('PRIVMSG')
|
@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 = bot.get_db_connection(input.server)
|
||||||
db_init(db)
|
db_init(db)
|
||||||
db.execute("insert or replace into seen(name, time, quote, chan)"
|
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.thread
|
||||||
@hook.event('PRIVMSG')
|
@hook.event('PRIVMSG')
|
||||||
def tellinput(inp, input=None, bot=None):
|
def tellinput(paraml, input=None, bot=None):
|
||||||
if 'showtells' in input.msg.lower():
|
if 'showtells' in input.msg.lower():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue