mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-25 20:41:19 -05:00
nag announces can be disabled, just set announceNagInterval to -1, and also, that allows plugin reload without issues
This commit is contained in:
parent
e33c69219a
commit
82424415d4
@ -132,7 +132,7 @@ conf.registerChannelValue(ChanTracker, 'announceNagMode',
|
||||
registry.CommaSeparatedListOfStrings([], """bot will announce that channel has such mode at announceNagInterval"""))
|
||||
|
||||
conf.registerGlobalValue(ChanTracker, 'announceNagInterval',
|
||||
registry.PositiveInteger(300,"""interval between two check about announceNagMode, this setting is global."""))
|
||||
registry.Integer(300,"""interval between two check about announceNagMode, this setting is global."""))
|
||||
|
||||
# others settings
|
||||
|
||||
|
@ -1165,7 +1165,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
self._ircs = ircutils.IrcDict()
|
||||
self.getIrc(irc)
|
||||
self.recaps = re.compile("[A-Z]")
|
||||
schedule.addEvent(self.checkNag,time.time()+self.registryValue('announceNagInterval'))
|
||||
if self.registryValue('announceNagInterval') > 0:
|
||||
schedule.addEvent(self.checkNag,time.time()+self.registryValue('announceNagInterval'))
|
||||
|
||||
def checkNag (self):
|
||||
if world:
|
||||
@ -1183,7 +1184,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
if self.registryValue('useColorForAnnounces',channel=channel):
|
||||
message = '[%s] has %s mode' % (ircutils.bold(channel),toNag)
|
||||
self._logChan(irc,channel,message)
|
||||
schedule.addEvent(self.checkNag,time.time()+self.registryValue('announceNagInterval'))
|
||||
if self.registryValue('announceNagInterval') > 0
|
||||
schedule.addEvent(self.checkNag,time.time()+self.registryValue('announceNagInterval'))
|
||||
|
||||
def summary (self,irc,msg,args,channel):
|
||||
"""[<channel>]
|
||||
|
Loading…
x
Reference in New Issue
Block a user