Problem Overview
I’m encountering a WrongFileIdentifier error while attempting to send media files with my Telegram bot developed using the aiogram framework. Although the bot initializes correctly and displays the proper name, it crashes when sending either photos or video notes.
Error Information
The key error message is:
aiogram.utils.exceptions.WrongFileIdentifier: Wrong file identifier/http url specified
This issue arises with both send_photo() and send_video_note() functions. I have followed a tutorial but only changed the configuration file to include my bot token and user ID, yet the media sending operations are failing.
Code Example
# This is a structure similar to what I'm working on
@dp.message_handler(commands=['photo'])
async def process_photo_request(msg: types.Message):
await bot.send_photo(msg.from_user.id, CAT_IMAGE_ID)
@dp.message_handler(commands=['video_note'])
async def process_video_note_request(msg: types.Message):
await bot.send_video_note(msg.from_user.id, SPHERE_VIDEO_ID)
Steps Taken
I precisely copied the code from the tutorial source and modified only the configuration parameters. The bot connects without issues but fails during media command handling. Has anyone experienced this file identifier issue? What might cause the wrong file identifier error?