bot - better handling of autocompletion on mobile devices

This commit is contained in:
Stefan Müller 2016-01-06 13:39:34 +01:00
parent 2d9ac3037e
commit 36eda158f2
1 changed files with 2 additions and 2 deletions

4
bot.py
View File

@ -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 [])