fix get_full_command

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-05 09:31:12 +01:00 committed by GitHub
parent 70767111c4
commit 5af5813231
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,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):
@ -191,7 +191,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):
"""