From 9cf8b9ad1cb1cc1151165a55afa4f3cf885ed345 Mon Sep 17 00:00:00 2001 From: Nicolas Coevoet Date: Thu, 17 Apr 2014 19:11:23 +0200 Subject: [PATCH] prevent bot to get stuck if chanserv isn't there --- plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin.py b/plugin.py index 14b4625..27656f8 100644 --- a/plugin.py +++ b/plugin.py @@ -1744,6 +1744,9 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler): # chan.syn is necessary, otherwise, bot can't call owner if rights missed ( see doNotice ) if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel): chan.opAsked = True + def f (): + chan.opAsked = False + schedule.addEvent(f,time.time() + 300) irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick))) retickle = True if len(chan.queue) or len(chan.action): @@ -1752,6 +1755,9 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler): if not chan.deopAsked: if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel): chan.opAsked = True + def f (): + chan.opAsked = False + schedule.addEvent(f,time.time() + 300) irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick))) retickle = True elif irc.nick in irc.state.channels[channel].ops: