a couple basic admin commands

tmp/79b4e7d7e0424f8155715d7c458859a1/head
Brian S. Stephan 13 years ago
parent 6765a539e9
commit d58f4ade61

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

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

Loading…
Cancel
Save