mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Merge pull request #29 from surik00/dev-1.x
Make Message's get_command method return pure command
This commit is contained in:
commit
83ed3f67ce
1 changed files with 5 additions and 2 deletions
|
|
@ -130,7 +130,7 @@ class Message(base.TelegramObject):
|
|||
command, _, args = self.text.partition(' ')
|
||||
return command, args
|
||||
|
||||
def get_command(self):
|
||||
def get_command(self, pure=False):
|
||||
"""
|
||||
Get command from message
|
||||
|
||||
|
|
@ -138,7 +138,10 @@ class Message(base.TelegramObject):
|
|||
"""
|
||||
command = self.get_full_command()
|
||||
if command:
|
||||
return command[0]
|
||||
command = command[0]
|
||||
if pure:
|
||||
command, _, _ = command[1:].partition('@')
|
||||
return command
|
||||
|
||||
def get_args(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue