From 36eda158f2d6a982183598bef7b0727e53fbc3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Wed, 6 Jan 2016 13:39:34 +0100 Subject: [PATCH] bot - better handling of autocompletion on mobile devices --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index ea54d42..631d82a 100644 --- a/bot.py +++ b/bot.py @@ -42,7 +42,7 @@ class Bot(): } def parse(self, message): - args = message.split(" ") + args = message.strip().split(" ") cmd = args.pop(0) if cmd[0] == '\\': @@ -56,7 +56,7 @@ class Bot(): self.send("a valid command starts with a backslash") def call(self, cmd, args = []): - func = self.commands[cmd] + func = self.commands[cmd.lower()] spec = inspect.getargspec(func) maxs = len(spec.args) - 1 reqs = maxs - len(spec.defaults or [])