fix get_full_command (#348)

The reason is that .partition() doesn't have a default param as .split has, and default split param gives possibility to split not only by whitespaces, but also whitespace consequences (so the .strip() in get_args() not needed) and newlines.
It's called "fix", because without it, commands like this:
'''/command
arg
arg1'''
are resulting with ('/command\narg\narg1', '', '')
This commit is contained in:
George Imedashvili 2020-06-08 18:21:15 +01:00 committed by GitHub
parent 50b5768759
commit 027139f1b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,7 @@ class Message(base.TelegramObject):
:return: tuple of (command, args)
"""
if self.is_command():
command, _, args = self.text.partition(' ')
command, args = self.text.split(maxsplit=1)
return command, args
def get_command(self, pure=False):
@ -192,7 +192,7 @@ class Message(base.TelegramObject):
"""
command = self.get_full_command()
if command:
return command[1].strip()
return command[1]
def parse_entities(self, as_html=True):
"""