Fix command parsing
This commit is contained in:
parent
615d1bb4c5
commit
9b0195aa72
1 changed files with 4 additions and 4 deletions
|
|
@ -293,10 +293,10 @@ class Bot():
|
||||||
# command name (!command)
|
# command name (!command)
|
||||||
split = message.split(maxsplit=1)
|
split = message.split(maxsplit=1)
|
||||||
|
|
||||||
if split[0][:1] != "!":
|
if len(split) < 2:
|
||||||
|
raise exceptions.ParseMessageException("Not enough arguments")
|
||||||
|
elif split[0][:1] != "!":
|
||||||
raise exceptions.ParseMessageException("Not a command")
|
raise exceptions.ParseMessageException("Not a command")
|
||||||
elif not len(split) > 1:
|
|
||||||
raise exceptions.ParseMessageException("No bot nick")
|
|
||||||
|
|
||||||
command = split[0][1:]
|
command = split[0][1:]
|
||||||
message = split[1]
|
message = split[1]
|
||||||
|
|
@ -308,7 +308,7 @@ class Bot():
|
||||||
except ValueError:
|
except ValueError:
|
||||||
bot_id = None
|
bot_id = None
|
||||||
else:
|
else:
|
||||||
if not len(split) > 1:
|
if len(split) <= 1:
|
||||||
raise exceptions.ParseMessageException("No bot nick")
|
raise exceptions.ParseMessageException("No bot nick")
|
||||||
|
|
||||||
message = split[1]
|
message = split[1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue