diff --git a/plugin.py b/plugin.py index 48e4285..c5577a0 100644 --- a/plugin.py +++ b/plugin.py @@ -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: