mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Prevent to trigger command filter with non-text messages
This commit is contained in:
parent
d92a77dbe2
commit
fb4eab7346
1 changed files with 3 additions and 0 deletions
|
|
@ -79,6 +79,9 @@ class Command(Filter):
|
|||
|
||||
@staticmethod
|
||||
async def check_command(message: types.Message, commands, prefixes, ignore_case=True, ignore_mention=False):
|
||||
if not message.text: # Prevent to use with non-text content types
|
||||
return False
|
||||
|
||||
full_command = message.text.split()[0]
|
||||
prefix, (command, _, mention) = full_command[0], full_command[1:].partition('@')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue