let mode be set in config
This commit is contained in:
parent
7888ce1314
commit
5ce63f7f21
|
@ -20,9 +20,9 @@ def invite(paraml, conn=None):
|
||||||
conn.join(paraml[-1])
|
conn.join(paraml[-1])
|
||||||
|
|
||||||
|
|
||||||
#join channels when server says hello & identify bot
|
|
||||||
@hook.event('004')
|
@hook.event('004')
|
||||||
def onjoin(paraml, conn=None):
|
def onjoin(paraml, conn=None):
|
||||||
|
# identify to services
|
||||||
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')
|
||||||
|
@ -30,6 +30,12 @@ def onjoin(paraml, conn=None):
|
||||||
conn.msg(nickserv_name, nickserv_command % nickserv_password)
|
conn.msg(nickserv_name, nickserv_command % nickserv_password)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
# set mode on self
|
||||||
|
mode = conn.conf.get('mode')
|
||||||
|
if mode:
|
||||||
|
conn.cmd('MODE', [conn.nick, mode])
|
||||||
|
|
||||||
|
# join channels
|
||||||
for channel in conn.channels:
|
for channel in conn.channels:
|
||||||
conn.join(channel)
|
conn.join(channel)
|
||||||
time.sleep(1) # don't flood JOINs
|
time.sleep(1) # don't flood JOINs
|
||||||
|
|
Loading…
Reference in New Issue