From 4a9b3fcebb8b9f99b443ba2ab2a1e4312a5f432a Mon Sep 17 00:00:00 2001 From: Irdumb Date: Thu, 7 Apr 2016 10:40:38 +1000 Subject: [PATCH 1/3] can add customcoms with (), "" fixed by Will/tekulvw --- cogs/customcom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/customcom.py b/cogs/customcom.py index 0b27ac551..ca2ea9848 100644 --- a/cogs/customcom.py +++ b/cogs/customcom.py @@ -14,7 +14,7 @@ class CustomCommands: @commands.command(pass_context=True, no_pm=True) @checks.mod_or_permissions(manage_server=True) - async def addcom(self, ctx, command : str, *text): + async def addcom(self, ctx, command : str, *, text): """Adds a custom command Example: @@ -41,7 +41,7 @@ class CustomCommands: @commands.command(pass_context=True, no_pm=True) @checks.mod_or_permissions(manage_server=True) - async def editcom(self, ctx, command : str, *text): + async def editcom(self, ctx, command : str, *, text): """Edits a custom command Example: @@ -153,4 +153,4 @@ def setup(bot): check_files() n = CustomCommands(bot) bot.add_listener(n.checkCC, "on_message") - bot.add_cog(n) \ No newline at end of file + bot.add_cog(n) From 1f641f6ebf097d3901408e241b797839ad94960e Mon Sep 17 00:00:00 2001 From: Irdumb Date: Thu, 7 Apr 2016 11:36:29 +1000 Subject: [PATCH 2/3] cleanup non-needed stuffs --- cogs/customcom.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cogs/customcom.py b/cogs/customcom.py index ca2ea9848..d33624d3c 100644 --- a/cogs/customcom.py +++ b/cogs/customcom.py @@ -20,9 +20,6 @@ class CustomCommands: Example: !addcom yourcommand Text you want """ - if text == (): - await send_cmd_help(ctx) - return server = ctx.message.server content = ctx.message.content chars = (len(ctx.prefix), len(ctx.invoked_with), len(command)) @@ -47,9 +44,6 @@ class CustomCommands: Example: !editcom yourcommand Text you want """ - if text == (): - await send_cmd_help(ctx) - return server = ctx.message.server content = ctx.message.content chars = (len(ctx.prefix), len(ctx.invoked_with), len(command)) From 57258f2fcc7cd7ccb519dcdbcad2d8f313d63c80 Mon Sep 17 00:00:00 2001 From: Irdumb Date: Thu, 7 Apr 2016 11:47:00 +1000 Subject: [PATCH 3/3] more cleanup --- cogs/customcom.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cogs/customcom.py b/cogs/customcom.py index d33624d3c..12b631219 100644 --- a/cogs/customcom.py +++ b/cogs/customcom.py @@ -21,9 +21,6 @@ class CustomCommands: !addcom yourcommand Text you want """ server = ctx.message.server - content = ctx.message.content - chars = (len(ctx.prefix), len(ctx.invoked_with), len(command)) - text = content[chars[0] + chars[1] + chars[2] + 2:] # Gets text of the command command = command.lower() if not server.id in self.c_commands: self.c_commands[server.id] = {} @@ -45,9 +42,6 @@ class CustomCommands: !editcom yourcommand Text you want """ server = ctx.message.server - content = ctx.message.content - chars = (len(ctx.prefix), len(ctx.invoked_with), len(command)) - text = content[chars[0] + chars[1] + chars[2] + 2:] # Gets text of the command command = command.lower() if server.id in self.c_commands: cmdlist = self.c_commands[server.id]