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