Always parse the same number of arguments; empty string != None
This commit is contained in:
parent
1beed6751b
commit
a0a1ef8989
|
@ -62,7 +62,7 @@ class Message:
|
||||||
def parse_content(self):
|
def parse_content(self):
|
||||||
"""Parse or reparse the message content"""
|
"""Parse or reparse the message content"""
|
||||||
# Remove !
|
# Remove !
|
||||||
if self.text[0] == '!':
|
if len(self.text) > 1 and self.text[0] == '!':
|
||||||
self.qual = "cmd"
|
self.qual = "cmd"
|
||||||
self.text = self.text[1:].strip()
|
self.text = self.text[1:].strip()
|
||||||
|
|
||||||
|
|
|
@ -271,11 +271,11 @@ class IRCMessage:
|
||||||
self.cmd = self.decode(p.group("command"))
|
self.cmd = self.decode(p.group("command"))
|
||||||
|
|
||||||
# Parse params
|
# Parse params
|
||||||
if p.group("params"):
|
if p.group("params") is not None:
|
||||||
for param in p.group("params").strip().split(b' '):
|
for param in p.group("params").strip().split(b' '):
|
||||||
self.params.append(param)
|
self.params.append(param)
|
||||||
|
|
||||||
if p.group("trailing"):
|
if p.group("trailing") is not None:
|
||||||
self.params.append(p.group("trailing"))
|
self.params.append(p.group("trailing"))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user