fix problem with 'none' permission

This commit is contained in:
jomo
2014-07-21 02:07:45 +02:00
parent befd5a1721
commit ce8b20aacd

View File

@@ -3,7 +3,7 @@ from helpers import *
from re import compile as reg_compile from re import compile as reg_compile
answers_filename = "plugins/redstoner-utils.py.dir/files/abot.json" answers_filename = "plugins/redstoner-utils.py.dir/files/abot.json"
answers = [] answers = []
def load_answers(): def load_answers():
@@ -57,7 +57,7 @@ def on_chat(event):
for answer in answers: for answer in answers:
for regex in answer["regex"]: for regex in answer["regex"]:
if regex.search(message): if regex.search(message):
if answer["hide-perm"] and not sender.hasPermission(answer["hide-perm"]): if not answer["hide-perm"] or not sender.hasPermission(answer["hide-perm"]):
plugin_header(sender, "AnswerBot") plugin_header(sender, "AnswerBot")
msg(sender, answer["message"] + "\n ") msg(sender, answer["message"] + "\n ")
event.setCancelled(True) event.setCancelled(True)