msgs = await self.bot.get_messages(user_id) - It's not working
telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetHistoryRequest)
GetHistoryRequest isn't working too, is it possible to get all chat history from bot?
No. You need to save the message id as you receive the updates.
That is, if I want to get all the photos that were sent to the bot, is it impossible?
You could workaround if you wish ms = [] i = 0 while True: i += 1 for m in await client.get_messages(chat, ids=list(range(i * 50, (i + 1) * 50))): if m: ms.append(m)
Обсуждают сегодня