mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-02 16:09:24 +01:00
Merge pull request #932 from GLolol/misc/customhelp
Misc: add ability to specify custom help strings
This commit is contained in:
commit
5fdf8c3c9e
@ -49,6 +49,9 @@ conf.registerGlobalValue(Misc, 'listPrivatePlugins',
|
|||||||
plugins with the list command if given the --private switch. If this is
|
plugins with the list command if given the --private switch. If this is
|
||||||
disabled, non-owner users should be unable to see what private plugins
|
disabled, non-owner users should be unable to see what private plugins
|
||||||
are loaded.""")))
|
are loaded.""")))
|
||||||
|
conf.registerGlobalValue(Misc, 'customHelpString',
|
||||||
|
registry.String('', _("""Sets a custom help string, displayed when the 'help'
|
||||||
|
command is called without arguments.""")))
|
||||||
conf.registerGlobalValue(Misc, 'listUnloadedPlugins',
|
conf.registerGlobalValue(Misc, 'listUnloadedPlugins',
|
||||||
registry.Boolean(False, _("""Determines whether the bot will list unloaded
|
registry.Boolean(False, _("""Determines whether the bot will list unloaded
|
||||||
plugins with the list command if given the --unloaded switch. If this is
|
plugins with the list command if given the --unloaded switch. If this is
|
||||||
|
@ -47,6 +47,7 @@ import supybot.irclib as irclib
|
|||||||
import supybot.ircmsgs as ircmsgs
|
import supybot.ircmsgs as ircmsgs
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
|
import supybot.registry as registry
|
||||||
from supybot import commands
|
from supybot import commands
|
||||||
|
|
||||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||||
@ -289,6 +290,13 @@ class Misc(callbacks.Plugin):
|
|||||||
You may also want to use the 'list' command to list all available
|
You may also want to use the 'list' command to list all available
|
||||||
plugins and commands.
|
plugins and commands.
|
||||||
"""
|
"""
|
||||||
|
if not command:
|
||||||
|
cHelp = self.registryValue("customHelpString")
|
||||||
|
if cHelp:
|
||||||
|
irc.reply(cHelp)
|
||||||
|
else:
|
||||||
|
irc.error()
|
||||||
|
return
|
||||||
command = list(map(callbacks.canonicalName, command))
|
command = list(map(callbacks.canonicalName, command))
|
||||||
(maxL, cbs) = irc.findCallbacksForArgs(command)
|
(maxL, cbs) = irc.findCallbacksForArgs(command)
|
||||||
if maxL == command:
|
if maxL == command:
|
||||||
@ -310,7 +318,7 @@ class Misc(callbacks.Plugin):
|
|||||||
'you may be able to find its provided commands '
|
'you may be able to find its provided commands '
|
||||||
'using \'list {0}\'.'.format(command[0].title()))
|
'using \'list {0}\'.'.format(command[0].title()))
|
||||||
irc.error(s)
|
irc.error(s)
|
||||||
help = wrap(help, [many('something')])
|
help = wrap(help, [any('something')])
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def version(self, irc, msg, args):
|
def version(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user