I was writing a Telegram bot noticed that it doesn't respond to photos. This echo bot should copy every message (other than /start
) and sendit back using message.send_copy(message.from_id)
. It works on simple text messages, but if I send a photo to the bot, it doesn't do anything. Here is the code:
import config
from aiogram import Bot, Dispatcher, executor, types
bot = Bot(config.TOKEN, parse_mode="HTML")
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start_cmd(message: types.Message):
await message.answer('Hello!')
@dp.message_handler()
async def echo(message: types.Message):
await message.send_copy(message.from_id)
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
I tried to use content_types='*'
like this:
@dp.message_handler(content_types='*')
async def echo(message: types.Message):
await message.send_copy(message.from_id)
but this did not work.