mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 17:33:44 +00:00
Upgraded Message's get_command method to return pure command
(backward compatible)
This commit is contained in:
parent
e756847579
commit
014be7bca6
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