Broke the code to check if isVoicePlus. Fixed in all 3 commands.

This commit is contained in:
spline 2013-05-27 18:12:35 -04:00
parent 9a2c05b601
commit edbfdd526d
1 changed files with 15 additions and 12 deletions

View File

@ -328,10 +328,11 @@ class Tweety(callbacks.Plugin):
"""
# enforce +voice or above to use command?
if self.registryValue('requireVoiceOrAbove', msg.args[0]):
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op?
irc.error("ERROR: You have to be at least voiced to use the trends command in {0}.".format(msg.args[0]))
return
if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check?
if ircutils.isChannel(msg.args[0]): # are we in a channel?
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @?
irc.error("ERROR: You have to be at least voiced to use the trends command in {0}.".format(msg.args[0]))
return
# before we do anything, make sure we have a twitterApi object.
if not self.twitterApi:
@ -390,10 +391,11 @@ class Tweety(callbacks.Plugin):
"""
# enforce +voice or above to use command?
if self.registryValue('requireVoiceOrAbove', msg.args[0]):
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op?
irc.error("ERROR: You have to be at least voiced to use the tsearch command in {0}.".format(msg.args[0]))
return
if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check?
if ircutils.isChannel(msg.args[0]): # are we in a channel?
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @?
irc.error("ERROR: You have to be at least voiced to use the tsearchcommand in {0}.".format(msg.args[0]))
return
# before we do anything, make sure we have a twitterApi object.
if not self.twitterApi:
@ -458,10 +460,11 @@ class Tweety(callbacks.Plugin):
"""
# enforce +voice or above to use command?
if self.registryValue('requireVoiceOrAbove', msg.args[0]):
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op?
irc.error("ERROR: You have to be at least voiced to use the twitter command in {0}.".format(msg.args[0]))
return
if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check?
if ircutils.isChannel(msg.args[0]): # are we in a channel?
if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @?
irc.error("ERROR: You have to be at least voiced to use the twitter command in {0}.".format(msg.args[0]))
return
# before we do anything, make sure we have a twitterApi object.
if not self.twitterApi: