change stophunt error message

This commit is contained in:
Gordon Shumway 2019-03-12 21:04:54 -04:00 committed by GitHub
parent 1a27d789e4
commit 2407bbf7f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -384,15 +384,14 @@ class DuckHunt(callbacks.Plugin):
if irc.isChannel(currentChannel):
if self.started.get(currentChannel) == True:
self._end(irc, msg, args)
else:
irc.reply('Nothing to stop: there\'s no hunt right now.')
# If someone uses the stop command,
# we stop the scheduler, even if autoRestart is enabled
try:
schedule.removeEvent('DuckHunt_' + currentChannel)
except KeyError:
irc.reply('Error: the spammer wasn\'t running! This is a bug.')
except:
irc.reply('Nothing to stop: there\'s no hunt right now.')
pass
else:
irc.error('You have to be on a channel')
stophunt = wrap(stophunt)
@ -1177,3 +1176,4 @@ class DuckHunt(callbacks.Plugin):
Class = DuckHunt
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: