'Bot does not send media telethon

I'm making a bot that displays new messages from different chats to the user. The first client, acting as a user, listens to the channels, and the second client, acting as a bot, displays a new message to the user.

from telethon import TelegramClient, events

api_id = '...'
api_hash = '...'
bot_token = '...'

client = TelegramClient('client', api_id, api_hash)
bot = TelegramClient('bot', api_id, api_hash).start(bot_token=bot_token)
client.start()

@client.on(events.NewMessage(chats=['...']))
async def main(event):
    await bot.send_message('...', event.message)

client.run_until_disconnected()

But there is a problem: if media appears in the message, then the bot does not send the message and displays the following error:

telethon.errors.rpcerrorlist.MediaEmptyError: The provided media object is invalid or the current account may not be able to send it (such as games as users) (caused by SendMediaRequest)

If the message is sent by the first client, then the message is sent and no error occurs. Help me please!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source