mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Fix getCommandHelp's use of dynamic.msg
Default chan to None so we can still retrieve a config value if dynamic.msg isn't valid (e.g., when running supybot-plugin-doc). Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
cedc4aaebe
commit
0615846ab3
@ -107,10 +107,12 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler):
|
||||
def getCommandHelp(self, command):
|
||||
method = self.getCommandMethod(command)
|
||||
if method.im_func.func_name == 'learn':
|
||||
s = self.registryValue('learnSeparator', dynamic.msg.args[0])
|
||||
chan = None
|
||||
if dynamic.msg is not None:
|
||||
chan = dynamic.msg.args[0]
|
||||
s = self.registryValue('learnSeparator', chan)
|
||||
help = callbacks.getHelp
|
||||
if conf.get(conf.supybot.reply.showSimpleSyntax,
|
||||
dynamic.msg.args[0]):
|
||||
if conf.get(conf.supybot.reply.showSimpleSyntax, chan):
|
||||
help = callbacks.getSyntax
|
||||
return help(method,
|
||||
doc=method._fake__doc__ % (s, s),
|
||||
|
@ -1200,10 +1200,11 @@ class Commands(BasePlugin):
|
||||
def getCommandHelp(self, command):
|
||||
method = self.getCommandMethod(command)
|
||||
help = getHelp
|
||||
m = dynamic.msg
|
||||
if m is not None:
|
||||
if conf.get(conf.supybot.reply.showSimpleSyntax, m.args[0]):
|
||||
help = getSyntax
|
||||
chan = None
|
||||
if dynamic.msg is not None:
|
||||
chan = dynamic.msg.args[0]
|
||||
if conf.get(conf.supybot.reply.showSimpleSyntax, chan):
|
||||
help = getSyntax
|
||||
if hasattr(method, '__doc__'):
|
||||
return help(method, name=formatCommand(command))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user