Проблема с аргументами (telethon + aiogram)

Имеется блок функций:

for source_channel_id, destination_channel_id in channel_mapping.items():
        if event.chat_id == source_channel_id:
            try:
                if event.message.media:
                    if isinstance(event.message.media, MessageMediaWebPage):
                        webpage_url = event.message.media.webpage.url
                        updated_text_with_url = f"{updated_text}"
                        await bot.send_message(destination_channel_id, updated_text_with_url)
                    else:
                        await bot.send_file(destination_channel_id, event.message.media, caption=original_text)
                else:
                    await bot.send_message(destination_channel_id, updated_text)

Отвечающий за постинг в чате о имени бота

Но одна функция не работает как надо, к именно

await client.send_file(destination_channel_id, event.message.media, caption=original_text)

Выходит ошибка:

ERROR:__main__:Ошибка при отправке сообщения: BaseBot.send_file() got an unexpected keyword argument 'caption

Если меняю bot на client + то постит норма, но от имени человека.

Что не так?


Ответы (0 шт):