Fixed custom commands

This commit is contained in:
Twentysix 2016-03-04 21:06:58 +01:00
parent 53df982559
commit d118fd17f3

View File

@ -24,8 +24,9 @@ class CustomCommands:
await send_cmd_help(ctx) await send_cmd_help(ctx)
return return
server = ctx.message.server server = ctx.message.server
to_replace = ctx.message.content.find(text[0]) content = ctx.message.content
text = ctx.message.content[to_replace:] 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() command = command.lower()
if not server.id in self.c_commands: if not server.id in self.c_commands:
self.c_commands[server.id] = {} self.c_commands[server.id] = {}
@ -50,8 +51,9 @@ class CustomCommands:
await send_cmd_help(ctx) await send_cmd_help(ctx)
return return
server = ctx.message.server server = ctx.message.server
to_replace = ctx.message.content.find(text[0]) content = ctx.message.content
text = ctx.message.content[to_replace:] 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() command = command.lower()
if server.id in self.c_commands: if server.id in self.c_commands:
cmdlist = self.c_commands[server.id] cmdlist = self.c_commands[server.id]