mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-07-13 15:14:48 -06:00
feat: enhance get_messages method to support pagination with page and offset parameters
This commit is contained in:
parent
40ab492eac
commit
5d5135ffec
@ -68,9 +68,13 @@ class ChatService:
|
|||||||
instance_token=instance_token
|
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'''
|
'''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(
|
return self.client.post(
|
||||||
f'chat/findMessages/{instance_id}',
|
f'chat/findMessages/{instance_id}',
|
||||||
data=payload,
|
data=payload,
|
||||||
|
Loading…
Reference in New Issue
Block a user