mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-07-13 15:14:48 -06:00
Merge pull request #5 from rafacalassara/add_get_messages
Add get messages
This commit is contained in:
commit
69112cd4c4
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Python-generated files
|
||||||
|
__pycache__/
|
||||||
|
*.cpython*.pyc
|
@ -66,4 +66,17 @@ class ChatService:
|
|||||||
f'chat/sendPresence/{instance_id}',
|
f'chat/sendPresence/{instance_id}',
|
||||||
data=data.__dict__,
|
data=data.__dict__,
|
||||||
instance_token=instance_token
|
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,
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user