a couple basic admin commands

This commit is contained in:
Brian S. Stephan 2010-07-24 12:42:25 -05:00
parent 6765a539e9
commit d58f4ade61
2 changed files with 17 additions and 1 deletions

View File

@ -8,3 +8,6 @@ name = dr. devzo
usermode = -x
debug = true
[admin]
userhost = bss@ayu.incorporeal.org

View File

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