Merge pull request #29 from surik00/dev-1.x

Make Message's get_command method return pure command
This commit is contained in:
Alex Root Junior 2018-04-01 15:53:39 +03:00 committed by GitHub
commit 83ed3f67ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ class Message(base.TelegramObject):
command, _, args = self.text.partition(' ') command, _, args = self.text.partition(' ')
return command, args return command, args
def get_command(self): def get_command(self, pure=False):
""" """
Get command from message Get command from message
@ -138,7 +138,10 @@ class Message(base.TelegramObject):
""" """
command = self.get_full_command() command = self.get_full_command()
if command: if command:
return command[0] command = command[0]
if pure:
command, _, _ = command[1:].partition('@')
return command
def get_args(self): def get_args(self):
""" """