Add save command in prompt, fixed issue #28
This commit is contained in:
parent
aced38a44b
commit
cec57b69ed
@ -133,6 +133,20 @@ def join(data, toks, context, prompt):
|
||||
srv.leave(toks[rd])
|
||||
return
|
||||
|
||||
def save_mod(data, toks, context, prompt):
|
||||
"""Force save module data"""
|
||||
if len(toks) < 2:
|
||||
print ("save: not enough arguments.")
|
||||
return
|
||||
|
||||
for mod in toks[1:]:
|
||||
if mod in context.modules:
|
||||
context.modules[mod].save()
|
||||
print ("save: module `%s´ saved successfully" % mod)
|
||||
else:
|
||||
print ("save: no module named `%s´" % mod)
|
||||
return
|
||||
|
||||
def send(data, toks, context, prompt):
|
||||
"""Send a message on a channel"""
|
||||
rd = 1
|
||||
|
@ -8,6 +8,7 @@
|
||||
<command name="join" call="join" />
|
||||
<command name="leave" call="join" />
|
||||
<command name="part" call="join" />
|
||||
<command name="save" call="save_mod" />
|
||||
<command name="send" call="send" />
|
||||
<command name="zap" call="zap" />
|
||||
</nemubotmodule>
|
||||
|
Loading…
Reference in New Issue
Block a user