Adds autoFriday channel value
This commit is contained in:
parent
0f51246f84
commit
313da89242
|
|
@ -60,6 +60,8 @@ conf.registerChannelValue(DuckHunt,
|
|||
conf.registerChannelValue(DuckHunt, 'kickMode',
|
||||
registry.Boolean(True, """If someone shoots when there is no duck, should he be kicked from the channel? (this requires the bot to be op on the channel)"""))
|
||||
|
||||
conf.registerChannelValue(DuckHunt, 'autoFriday',
|
||||
registry.Boolean(True, """ Do we need to automatically launch more ducks on friday? """))
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -179,6 +179,13 @@ class DuckHunt(callbacks.Plugin):
|
|||
|
||||
if (not self.fridayMode.get(channel)):
|
||||
self.fridayMode[channel] = False
|
||||
|
||||
|
||||
# autoFriday?
|
||||
if self.registryValue('autoFriday', channel) and int(time.strftime("%w")) == 5 and int(time.strftime("%H")) > 8 and int(time.strftime("%H")) < 18:
|
||||
self.fridayMode[channel] = True
|
||||
|
||||
|
||||
if self.fridayMode[channel] == False:
|
||||
# Init min throttle[currentChannel] and max throttle[currentChannel]
|
||||
if self.registryValue('minthrottle', channel):
|
||||
|
|
@ -342,7 +349,7 @@ class DuckHunt(callbacks.Plugin):
|
|||
irc.error('You have to be on a channel')
|
||||
|
||||
|
||||
fridaymode = wrap(fridaymode, ['channel'])
|
||||
fridaymode = wrap(fridaymode, ['channel', 'admin'])
|
||||
|
||||
def launched(self, irc, msg, args):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue