let mode be set in config

This commit is contained in:
Ryan Hitchman 2010-03-14 17:55:58 -06:00
parent 7888ce1314
commit 5ce63f7f21
1 changed files with 8 additions and 2 deletions

View File

@ -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