Вот мой код:
import token
import logging
from aiogram import Bot, Dispatcher, executor, types
logging.basicConfig(level=logging.INFO)
bot = Bot(token=token.TOKEN)
dp = Dispatcher(bot)
#remove new user joined messages
# delete message
@dp.message_handler()
async def filter_messages(message: types.message):
if "Плохое слово" in message.text:
await message.delete()
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
Вот ошибка:
File "bot.py", line 14
async def filter_messages(message: types.message):
^
SyntaxError: invalid syntax