From 5125e86d21ad80a8b7b4d1457ff2172d46c1d16d Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sat, 1 Oct 2016 15:29:37 -0500 Subject: [PATCH] Checked for error where no permission was provided when trying to add a custom permissoin --- cogs/mod.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cogs/mod.py b/cogs/mod.py index cb390ca..91bb2af 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -170,7 +170,11 @@ class Mod: # Since subcommands exist, base the last word in the list as the permission, and the rest of it as the command command = " ".join(msg[0:len(msg) - 1]) - permissions = msg[len(msg) - 1] + try: + permissions = msg[len(msg) - 1] + except IndexError: + await self.bot.say("Please provide the permissions you want to setup, the format for this must be in:\n" + "`perms add `") # If a user can run a command, they have to have send_messages permissions; so use this as the base if permissions.lower() == "none":