From d118fd17f35ca0781a8c61eeaca3aa741113d40c Mon Sep 17 00:00:00 2001 From: Twentysix Date: Fri, 4 Mar 2016 21:06:58 +0100 Subject: [PATCH] Fixed custom commands --- cogs/customcom.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cogs/customcom.py b/cogs/customcom.py index ef76eeb42..27061d9fb 100644 --- a/cogs/customcom.py +++ b/cogs/customcom.py @@ -24,8 +24,9 @@ class CustomCommands: await send_cmd_help(ctx) return server = ctx.message.server - to_replace = ctx.message.content.find(text[0]) - text = ctx.message.content[to_replace:] + 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] = {} @@ -50,8 +51,9 @@ class CustomCommands: await send_cmd_help(ctx) return server = ctx.message.server - to_replace = ctx.message.content.find(text[0]) - text = ctx.message.content[to_replace:] + 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]