Merge pull request #5 from rafacalassara/add_get_messages

Add get messages
This commit is contained in:
Davidson Gomes
2025-01-06 12:22:51 -03:00
committed by GitHub
2 changed files with 17 additions and 1 deletions
Vendored
+3
View File
@@ -0,0 +1,3 @@
# Python-generated files
__pycache__/
*.cpython*.pyc
+13
View File
@@ -67,3 +67,16 @@ class ChatService:
data=data.__dict__,
instance_token=instance_token
)
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}},
"page": page,
"offset": offset,
}
return self.client.post(
f'chat/findMessages/{instance_id}',
data=payload,
instance_token=instance_token,
)