Only +v or +o users can issue bot commands
Limit access to the bot to voiced or oped users in the target channel. This lets us use ChanServ to autovoice users but also give temprary access to anyone on-channel as necessary.
This commit is contained in:
parent
8f2f63bdfe
commit
c0cb4a0bdd
|
@ -100,7 +100,11 @@ class PTGBot(irc.bot.SingleServerIRCBot):
|
||||||
msg = e.arguments[0][1:]
|
msg = e.arguments[0][1:]
|
||||||
chan = e.target
|
chan = e.target
|
||||||
|
|
||||||
if msg.startswith('#') and auth:
|
if msg.startswith('#'):
|
||||||
|
if not (self.channels[chan].is_voiced(nick) or
|
||||||
|
self.channels[chan].is_oper(nick)):
|
||||||
|
self.send(chan, "%s: Need voice to issue commands" % (nick,))
|
||||||
|
return
|
||||||
words = msg.split()
|
words = msg.split()
|
||||||
if len(words) < 3:
|
if len(words) < 3:
|
||||||
self.send(chan, "%s: Incorrect number of arguments" % (nick,))
|
self.send(chan, "%s: Incorrect number of arguments" % (nick,))
|
||||||
|
|
Loading…
Reference in New Issue