mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +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):
|
def getCommandHelp(self, command):
|
||||||
method = self.getCommandMethod(command)
|
method = self.getCommandMethod(command)
|
||||||
if method.im_func.func_name == 'learn':
|
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
|
help = callbacks.getHelp
|
||||||
if conf.get(conf.supybot.reply.showSimpleSyntax,
|
if conf.get(conf.supybot.reply.showSimpleSyntax, chan):
|
||||||
dynamic.msg.args[0]):
|
|
||||||
help = callbacks.getSyntax
|
help = callbacks.getSyntax
|
||||||
return help(method,
|
return help(method,
|
||||||
doc=method._fake__doc__ % (s, s),
|
doc=method._fake__doc__ % (s, s),
|
||||||
|
@ -1200,9 +1200,10 @@ class Commands(BasePlugin):
|
|||||||
def getCommandHelp(self, command):
|
def getCommandHelp(self, command):
|
||||||
method = self.getCommandMethod(command)
|
method = self.getCommandMethod(command)
|
||||||
help = getHelp
|
help = getHelp
|
||||||
m = dynamic.msg
|
chan = None
|
||||||
if m is not None:
|
if dynamic.msg is not None:
|
||||||
if conf.get(conf.supybot.reply.showSimpleSyntax, m.args[0]):
|
chan = dynamic.msg.args[0]
|
||||||
|
if conf.get(conf.supybot.reply.showSimpleSyntax, chan):
|
||||||
help = getSyntax
|
help = getSyntax
|
||||||
if hasattr(method, '__doc__'):
|
if hasattr(method, '__doc__'):
|
||||||
return help(method, name=formatCommand(command))
|
return help(method, name=formatCommand(command))
|
||||||
|
Loading…
Reference in New Issue
Block a user