Prevent to trigger command filter with non-text messages

This commit is contained in:
Alex Root Junior 2019-10-06 23:17:49 +03:00
parent d92a77dbe2
commit fb4eab7346

View file

@ -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('@')