@@ -59,9 +59,9 @@ class Access(Command): | |||||
def do_list(self, data, permdb): | def do_list(self, data, permdb): | ||||
if len(data.args) > 1: | if len(data.args) > 1: | ||||
if data.args[1] in ["owner", "owners"]: | if data.args[1] in ["owner", "owners"]: | ||||
name, rules = "owners", permdb.data.get(permdb.OWNERS) | |||||
name, rules = "owners", permdb.data.get(permdb.OWNER) | |||||
elif data.args[1] in ["admin", "admins"]: | elif data.args[1] in ["admin", "admins"]: | ||||
name, rules = "admins", permdb.data.get(permdb.ADMINS) | |||||
name, rules = "admins", permdb.data.get(permdb.ADMIN) | |||||
else: | else: | ||||
msg = "Unknown access level \x0302{0}\x0F." | msg = "Unknown access level \x0302{0}\x0F." | ||||
self.reply(data, msg.format(data.args[1])) | self.reply(data, msg.format(data.args[1])) | ||||
@@ -72,8 +72,8 @@ class Access(Command): | |||||
msg = "No bot {0}.".format(name) | msg = "No bot {0}.".format(name) | ||||
self.reply(data, msg) | self.reply(data, msg) | ||||
else: | else: | ||||
owners = len(permdb.data.get(permdb.OWNERS, [])) | |||||
admins = len(permdb.data.get(permdb.ADMINS, [])) | |||||
owners = len(permdb.data.get(permdb.OWNER, [])) | |||||
admins = len(permdb.data.get(permdb.ADMIN, [])) | |||||
msg = "There are {0} bot owners and {1} bot admins. Use '!{2} list owners' or '!{2} list admins' for details." | msg = "There are {0} bot owners and {1} bot admins. Use '!{2} list owners' or '!{2} list admins' for details." | ||||
self.reply(data, msg.format(owners, admins, data.command)) | self.reply(data, msg.format(owners, admins, data.command)) | ||||
@@ -50,7 +50,7 @@ class Data(object): | |||||
def _parse(self, msgtype): | def _parse(self, msgtype): | ||||
"""Parse a line from IRC into its components as instance attributes.""" | """Parse a line from IRC into its components as instance attributes.""" | ||||
sender = re.findall(":(.*?)!(.*?)@(.*?)\Z", self.line[0])[0] | |||||
sender = re.findall(r":(.*?)!(.*?)@(.*?)\Z", self.line[0])[0] | |||||
self._nick, self._ident, self._host = sender | self._nick, self._ident, self._host = sender | ||||
self._chan = self.line[2] | self._chan = self.line[2] | ||||
@@ -84,7 +84,8 @@ class Data(object): | |||||
self._is_command = True | self._is_command = True | ||||
self._trigger = self.command[0] | self._trigger = self.command[0] | ||||
self._command = self.command[1:] # Strip the "!" or "." | self._command = self.command[1:] # Strip the "!" or "." | ||||
elif re.match(r"{0}\W*?$".format(self.my_nick), self.command, re.U): | |||||
elif re.match(r"{0}\W*?$".format(re.escape(self.my_nick)), | |||||
self.command, re.U): | |||||
# e.g. "EarwigBot, command arg1 arg2" | # e.g. "EarwigBot, command arg1 arg2" | ||||
self._is_command = True | self._is_command = True | ||||
self._trigger = self.my_nick | self._trigger = self.my_nick | ||||
@@ -110,7 +111,7 @@ class Data(object): | |||||
""" | """ | ||||
for arg in self.args: | for arg in self.args: | ||||
try: | try: | ||||
key, value = re.findall("^(.*?)\=(.*?)$", arg)[0] | |||||
key, value = re.findall(r"^(.*?)\=(.*?)$", arg)[0] | |||||
except IndexError: | except IndexError: | ||||
continue | continue | ||||
if key and value: | if key and value: | ||||