mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
plugins/Services: Make ghostDelay configurable with a default of 60 seconds.
This commit is contained in:
parent
c3cacbce76
commit
9214f6ac87
@ -66,17 +66,19 @@ conf.registerGlobalValue(Services, 'nicks',
|
||||
|
||||
class Networks(registry.SpaceSeparatedSetOfStrings):
|
||||
List = ircutils.IrcSet
|
||||
|
||||
|
||||
conf.registerGlobalValue(Services, 'disabledNetworks',
|
||||
Networks(['QuakeNet'], """Determines what networks this plugin will be
|
||||
disabled on."""))
|
||||
|
||||
conf.registerGlobalValue(Services,
|
||||
'noJoinsUntilIdentified',
|
||||
conf.registerGlobalValue(Services, 'noJoinsUntilIdentified',
|
||||
registry.Boolean(False, """Determines whether the bot will not join any
|
||||
channels until it is identified. This may be useful, for instances, if
|
||||
you have a vhost that isn't set until you're identified, or if you're
|
||||
joining +r channels that won't allow you to join unless you identify."""))
|
||||
conf.registerGlobalValue(Services, 'ghostDelay',
|
||||
registry.PositiveInteger(60, """Determines how many seconds the bot will
|
||||
wait between successive GHOST attempts."""))
|
||||
conf.registerGlobalValue(Services, 'NickServ',
|
||||
ValidNickOrEmptyString('', """Determines what nick the 'NickServ' service
|
||||
has."""))
|
||||
|
@ -40,8 +40,6 @@ import supybot.ircutils as ircutils
|
||||
import supybot.schedule as schedule
|
||||
import supybot.callbacks as callbacks
|
||||
|
||||
ghostDelay = 60
|
||||
|
||||
class Services(callbacks.Plugin):
|
||||
"""This plugin handles dealing with Services on networks that provide them.
|
||||
Basically, you should use the "password" command to tell the bot a nick to
|
||||
@ -117,6 +115,7 @@ class Services(callbacks.Plugin):
|
||||
return
|
||||
nickserv = self.registryValue('NickServ')
|
||||
password = self._getNickServPassword(nick)
|
||||
ghostDelay = self.registryValue('ghostDelay')
|
||||
if not nickserv or not password:
|
||||
s = 'Tried to ghost without a NickServ or password set.'
|
||||
self.log.warning(s)
|
||||
@ -146,6 +145,7 @@ class Services(callbacks.Plugin):
|
||||
return
|
||||
nickserv = self.registryValue('NickServ')
|
||||
password = self._getNickServPassword(nick)
|
||||
ghostDelay = self.registryValue('ghostDelay')
|
||||
if nick and nickserv and password and \
|
||||
not ircutils.strEqual(nick, irc.nick):
|
||||
if irc.afterConnect and self.sentGhost is None or \
|
||||
|
Loading…
Reference in New Issue
Block a user