diff --git a/evolutionapi/services/chat.py b/evolutionapi/services/chat.py index b5d4350..d4d3291 100644 --- a/evolutionapi/services/chat.py +++ b/evolutionapi/services/chat.py @@ -68,9 +68,13 @@ class ChatService: instance_token=instance_token ) - def get_messages(self, instance_id: str, remote_jid: str, instance_token: str): + def get_messages(self, instance_id: str, remote_jid: str, instance_token: str, page: int = 1, offset: int = 50): '''Get messages from a chat''' - payload = {"where": {"key": {"remoteJid": remote_jid}}} + payload = { + "where": {"key": {"remoteJid": remote_jid}}, + "page": page, + "offset": offset, + } return self.client.post( f'chat/findMessages/{instance_id}', data=payload,