diff --git a/plugins/Factoids/plugin.py b/plugins/Factoids/plugin.py index ab138f4b5..edfda64a9 100644 --- a/plugins/Factoids/plugin.py +++ b/plugins/Factoids/plugin.py @@ -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), diff --git a/src/callbacks.py b/src/callbacks.py index ef24459bb..7db2bfa45 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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: