Commit 394a6205 authored by Mindiell's avatar Mindiell

Fixed admin and help command which were taking only the ~ in account.

parent 2031f09e
...@@ -290,12 +290,12 @@ class Wantzel(object): ...@@ -290,12 +290,12 @@ class Wantzel(object):
def help(self, user, channel, msg): def help(self, user, channel, msg):
""" """
Show global help. Show global help.
If a known command is behind the ~help command, an adequate message is If a known command is behind the ~!help command, an adequate message is
returned. returned.
""" """
Utils.debug("help command") Utils.debug("help command")
# Searching for a command after help keyword # Searching for a command after help keyword
command = re.search("~help (help|rp|status|stats|kill|admin)", msg) command = re.search("[!~]help (help|rp|status|stats|kill|admin)", msg)
if command: if command:
command = command.group(1) command = command.group(1)
self.send_message(user, messages["help_"+command]) self.send_message(user, messages["help_"+command])
...@@ -451,11 +451,11 @@ class Wantzel(object): ...@@ -451,11 +451,11 @@ class Wantzel(object):
def admin(self, user, channel, msg): def admin(self, user, channel, msg):
""" """
Manage moderation. Manage moderation.
A sub-command should be behind the ~admin command. A sub-command should be behind the !~admin command.
""" """
Utils.debug("admin command") Utils.debug("admin command")
# Searching for a command after admin keyword # Searching for a command after admin keyword
command = re.search("~admin (list|add|del|timer)", msg) command = re.search("[~!]admin (list|add|del|timer)", msg)
if command: if command:
command = command.group(1) command = command.group(1)
if command == "list": if command == "list":
...@@ -490,7 +490,7 @@ class Wantzel(object): ...@@ -490,7 +490,7 @@ class Wantzel(object):
try: try:
names = [] names = []
connection = sqlite3.connect(config.sqlite_db) connection = sqlite3.connect(config.sqlite_db)
result = re.search("~admin add (([^,]+, ?)+)?(.*)", msg) result = re.search("[!~]admin add (([^,]+, ?)+)?(.*)", msg)
if result.group(1): if result.group(1):
names = [name.strip() for name in result.group(1).split(",") if name.strip() != ""] names = [name.strip() for name in result.group(1).split(",") if name.strip() != ""]
names.append(result.group(3)) names.append(result.group(3))
...@@ -520,7 +520,7 @@ class Wantzel(object): ...@@ -520,7 +520,7 @@ class Wantzel(object):
if is_moderator(user): if is_moderator(user):
try: try:
names = [] names = []
result = re.search("~admin del (([^,]+, ?)+)?(.*)", msg) result = re.search("[!~]admin del (([^,]+, ?)+)?(.*)", msg)
if result.group(1): if result.group(1):
names = [name.strip() for name in result.group(1).split(",") if name.strip() != ""] names = [name.strip() for name in result.group(1).split(",") if name.strip() != ""]
names.append(result.group(3)) names.append(result.group(3))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment