I have a Python script where I fetch messages of a channel using the following code:
entity = InputPeerChannel(int(chat_id), int(chat_hash))
async for message in client.iter_messages(entity, reverse = True, offset_date = offset_date):
#Some stuff to save messages
This works perfectly fine with channels, however I also have groups for which I get the ChannelInvalidError
. Which function do I have to use to fetch messages for groups if I have their chat_id
and access_hash
?