Adds autoFriday channel value

This commit is contained in:
Matthias Meusburger 2012-09-09 17:08:05 +02:00
parent 0f51246f84
commit 313da89242
2 changed files with 10 additions and 1 deletions

View File

@ -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? """))

View File

@ -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):
"""