Adds kickMode :)
This commit is contained in:
parent
5830c4007e
commit
80a482bc83
|
|
@ -57,6 +57,10 @@ conf.registerChannelValue(DuckHunt,
|
|||
'maxthrottle', registry.Integer(300, """
|
||||
The maximum amount of time before a new duck may be launched (in seconds)"""))
|
||||
|
||||
conf.registerChannelValue(DuckHunt, 'kickMode',
|
||||
registry.Boolean(True, """If someone shoots when there is no duck, should he be kicked from the channel?"""))
|
||||
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import supybot.conf as conf
|
|||
|
||||
import threading, random, pickle, os, time, datetime
|
||||
|
||||
# TODO: Average time
|
||||
|
||||
class DuckHunt(callbacks.Plugin):
|
||||
"""
|
||||
|
|
@ -668,6 +669,11 @@ class DuckHunt(callbacks.Plugin):
|
|||
irc.reply("There was no duck! %s: %i (%.2f seconds) " % (msg.nick, self.scores[currentChannel][msg.nick], bangdelay))
|
||||
else:
|
||||
irc.reply("There was no duck! %s: %i" % (msg.nick, self.scores[currentChannel][msg.nick]))
|
||||
|
||||
# If kickMode is enabled for this channel, and the bot have op capability, let's kick!
|
||||
if self.registryValue('kickMode', currentChannel) and irc.nick in irc.state.channels[currentChannel].ops:
|
||||
irc.queueMsg(ircmsgs.kick(currentChannel, msg.nick, 'There was no duck! You just shot yourself!'))
|
||||
|
||||
else:
|
||||
irc.reply("There is no hunt right now! You can start a hunt with the 'start' command")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue