Factoids, Services: Fix crash when imported by supybot-plugin-doc

This commit is contained in:
Valentin Lorentz 2021-04-05 11:30:59 +02:00
parent c28d517d6f
commit 24f20dcb86
2 changed files with 5 additions and 2 deletions

View File

@ -262,8 +262,10 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler):
s = self.registryValue('learnSeparator', chan, network) s = self.registryValue('learnSeparator', chan, network)
help = callbacks.getHelp help = callbacks.getHelp
if simpleSyntax is None: if simpleSyntax is None:
irc = dynamic.irc
network = irc.network if irc else None
simpleSyntax = conf.supybot.reply.showSimpleSyntax.getSpecific( simpleSyntax = conf.supybot.reply.showSimpleSyntax.getSpecific(
dynamic.irc.network, chan)() network, chan)()
if simpleSyntax: if simpleSyntax:
help = callbacks.getSyntax help = callbacks.getSyntax
return help(method, return help(method,

View File

@ -61,7 +61,8 @@ class Services(callbacks.Plugin):
def __init__(self, irc): def __init__(self, irc):
self.__parent = super(Services, self) self.__parent = super(Services, self)
self.__parent.__init__(irc) self.__parent.__init__(irc)
for nick in self.registryValue('nicks', network=irc.network): network = irc.network if irc else None
for nick in self.registryValue('nicks', network=network):
config.registerNick(nick) config.registerNick(nick)
self.reset() self.reset()