|
|
|
@ -28,7 +28,20 @@ def on_connect(connection, event):
|
|
|
|
|
#####
|
|
|
|
|
|
|
|
|
|
def on_privmsg(connection, event):
|
|
|
|
|
print 'privmsg: ' + event.target() + '> ' + event.source().split('!')[0] + ': ' + event.arguments()[0]
|
|
|
|
|
nick = event.source().split('!')[0]
|
|
|
|
|
userhost = event.source().split('!')[1]
|
|
|
|
|
what = event.arguments()[0]
|
|
|
|
|
admin_unlocked = False
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
if userhost == config.get('admin', 'userhost'):
|
|
|
|
|
admin_unlocked = True
|
|
|
|
|
except NoOptionError: pass
|
|
|
|
|
|
|
|
|
|
if what.split(' ')[0] == 'join' and admin_unlocked:
|
|
|
|
|
connection.join(what.split(' ')[1])
|
|
|
|
|
elif what.split(' ')[0] == 'part' and admin_unlocked:
|
|
|
|
|
connection.part(what.split(' ')[1], ' '.join(what.split(' ')[2:]))
|
|
|
|
|
|
|
|
|
|
#####
|
|
|
|
|
# init
|
|
|
|
|