a couple basic admin commands
This commit is contained in:
parent
6765a539e9
commit
d58f4ade61
|
@ -8,3 +8,6 @@ name = dr. devzo
|
||||||
usermode = -x
|
usermode = -x
|
||||||
|
|
||||||
debug = true
|
debug = true
|
||||||
|
|
||||||
|
[admin]
|
||||||
|
userhost = bss@ayu.incorporeal.org
|
||||||
|
|
15
dr.botzo.py
15
dr.botzo.py
|
@ -28,7 +28,20 @@ def on_connect(connection, event):
|
||||||
#####
|
#####
|
||||||
|
|
||||||
def on_privmsg(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
|
# init
|
||||||
|
|
Loading…
Reference in New Issue