diff --git a/config.py b/config.py index b28e7e7..66b052f 100644 --- a/config.py +++ b/config.py @@ -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: diff --git a/plugin.py b/plugin.py index 041eae1..9b0469c 100644 --- a/plugin.py +++ b/plugin.py @@ -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: