mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 13:01:06 -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"""))
|
registry.CommaSeparatedListOfStrings([], """bot will announce that channel has such mode at announceNagInterval"""))
|
||||||
|
|
||||||
conf.registerGlobalValue(ChanTracker, '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
|
# others settings
|
||||||
|
|
||||||
|
@ -1165,7 +1165,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
self._ircs = ircutils.IrcDict()
|
self._ircs = ircutils.IrcDict()
|
||||||
self.getIrc(irc)
|
self.getIrc(irc)
|
||||||
self.recaps = re.compile("[A-Z]")
|
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):
|
def checkNag (self):
|
||||||
if world:
|
if world:
|
||||||
@ -1183,7 +1184,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
if self.registryValue('useColorForAnnounces',channel=channel):
|
if self.registryValue('useColorForAnnounces',channel=channel):
|
||||||
message = '[%s] has %s mode' % (ircutils.bold(channel),toNag)
|
message = '[%s] has %s mode' % (ircutils.bold(channel),toNag)
|
||||||
self._logChan(irc,channel,message)
|
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):
|
def summary (self,irc,msg,args,channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user