added help for the IrcAdmin module
This commit is contained in:
parent
d68487de95
commit
66a736b108
@ -166,5 +166,51 @@ class IrcAdmin(Module):
|
|||||||
|
|
||||||
return ', '.join(self.irc.list_modules())
|
return ', '.join(self.irc.list_modules())
|
||||||
|
|
||||||
|
def help_description(self):
|
||||||
|
"""Return a quick list of commands or other summary, should be
|
||||||
|
less than two lines. If you want the module hidden from "!help",
|
||||||
|
return None here"""
|
||||||
|
return "Perform admin-related functions."
|
||||||
|
|
||||||
|
def help_summary(self):
|
||||||
|
"""Return a command summary or longer description of this module.
|
||||||
|
If this returns None, the summary will be
|
||||||
|
"no help available for module foo"
|
||||||
|
"""
|
||||||
|
return """Bot admin commands (do '!help IrcAdmin [cmd] for details):
|
||||||
|
!join, !part, !quit, !autojoin, !save, !nick, !load, !reload, !unload, !modules"""
|
||||||
|
|
||||||
|
def help_detail(self, command):
|
||||||
|
"""Return detailed help for the given command. Return None if there
|
||||||
|
is no suitable help available"""
|
||||||
|
key = command.strip()
|
||||||
|
if key[0] == '!':
|
||||||
|
key = key[1:]
|
||||||
|
words = key.split()
|
||||||
|
if len(words) == 0:
|
||||||
|
return None
|
||||||
|
elif words[0] == 'join':
|
||||||
|
return "!join [channel] - cause the bot to /join [channel]"
|
||||||
|
elif words[0] == 'part':
|
||||||
|
return "!part [channel] - cause the bot to /part from [channel]"
|
||||||
|
elif words[0] == 'quit':
|
||||||
|
return "!quit - cause the bot to save itself and quit"
|
||||||
|
elif words[0] == 'autojoin':
|
||||||
|
return "!autojoin [channel] - cause the bot to join [channel] on startup"
|
||||||
|
elif words[0] == 'save':
|
||||||
|
return "!save - cause the bot to save config data to the config file"
|
||||||
|
elif words[0] == 'nick':
|
||||||
|
return "!nick - cause the bot to change its nick"
|
||||||
|
elif words[0] == 'load':
|
||||||
|
return "!load - make the bot load a module dynamically"
|
||||||
|
elif words[0] == 'reload':
|
||||||
|
return "!reload - reload an already-loaded module"
|
||||||
|
elif words[0] == 'unload':
|
||||||
|
return "!unload - unload a loaded module, removing its functionality"
|
||||||
|
elif words[0] == 'modules':
|
||||||
|
return "!modules - list the currently loaded modules"
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
# vi:tabstop=4:expandtab:autoindent
|
# vi:tabstop=4:expandtab:autoindent
|
||||||
# kate: indent-mode python;indent-width 4;replace-tabs on;
|
# kate: indent-mode python;indent-width 4;replace-tabs on;
|
||||||
|
Loading…
Reference in New Issue
Block a user