pythonmessagetelethon

Telethon, how to get messages from chat, but not don't make requests to get user entites


I am using Telethon and I am getting messages from chat, but as I can see in session file - I have a lot off entities added with users(senders, I think). So I get WaitFloodError looks like because a lot of requests to users also.

So, my question is: Is it possible to make history message request of chat but don't make request to sender so I can bypass WaitFloodError a little bit. I need only info about message.

messages = await client.get_messages(entity=my_channel,search=None,offset_id=offset_id,offset_date=None,add_offset=0,limit=limit,max_id=0,min_id=0) 

I have tried GetHistoryRequest, get_messages and looked in documentation for some info how to turn off request to sender, but didn't find any information. Thanks


Solution

  • Nope, looking at the client source, there doesn't seem to be a option not to retrieve those user details.

    To prevent the WaitFloodError, there are some options on get_messages like wait_time which can help: