diff --git a/README.md b/README.md index b11dacc..8b38e73 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,17 @@ mensagem = ReadMessage( response = client.chat.mark_message_as_read(instance_id, [mensagem], instance_token) ``` +#### Obter Mensagens do Chat +```python +response = client.chat.get_messages( + instance_id, + remote_jid="5511999999999@s.whatsapp.net", + instance_token=instance_token, + page=1, # página opcional (padrão: 1) + offset=50 # limite de mensagens por página opcional (padrão: 50) +) +``` + ### Chamadas #### Simular Chamada diff --git a/evolutionapi/__pycache__/__init__.cpython-310.pyc b/evolutionapi/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index c146c2c..0000000 Binary files a/evolutionapi/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/__pycache__/client.cpython-310.pyc b/evolutionapi/__pycache__/client.cpython-310.pyc deleted file mode 100644 index 5834b25..0000000 Binary files a/evolutionapi/__pycache__/client.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/__pycache__/exceptions.cpython-310.pyc b/evolutionapi/__pycache__/exceptions.cpython-310.pyc deleted file mode 100644 index a25e4ba..0000000 Binary files a/evolutionapi/__pycache__/exceptions.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/__init__.cpython-310.pyc b/evolutionapi/models/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 9ee8c37..0000000 Binary files a/evolutionapi/models/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/call.cpython-310.pyc b/evolutionapi/models/__pycache__/call.cpython-310.pyc deleted file mode 100644 index 499d3b4..0000000 Binary files a/evolutionapi/models/__pycache__/call.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/chat.cpython-310.pyc b/evolutionapi/models/__pycache__/chat.cpython-310.pyc deleted file mode 100644 index 8bb786d..0000000 Binary files a/evolutionapi/models/__pycache__/chat.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/group.cpython-310.pyc b/evolutionapi/models/__pycache__/group.cpython-310.pyc deleted file mode 100644 index 75420b3..0000000 Binary files a/evolutionapi/models/__pycache__/group.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/instance.cpython-310.pyc b/evolutionapi/models/__pycache__/instance.cpython-310.pyc deleted file mode 100644 index 5423768..0000000 Binary files a/evolutionapi/models/__pycache__/instance.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/label.cpython-310.pyc b/evolutionapi/models/__pycache__/label.cpython-310.pyc deleted file mode 100644 index 7d43c16..0000000 Binary files a/evolutionapi/models/__pycache__/label.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/message.cpython-310.pyc b/evolutionapi/models/__pycache__/message.cpython-310.pyc deleted file mode 100644 index e4b054f..0000000 Binary files a/evolutionapi/models/__pycache__/message.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/presence.cpython-310.pyc b/evolutionapi/models/__pycache__/presence.cpython-310.pyc deleted file mode 100644 index 68a2b0a..0000000 Binary files a/evolutionapi/models/__pycache__/presence.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/models/__pycache__/profile.cpython-310.pyc b/evolutionapi/models/__pycache__/profile.cpython-310.pyc deleted file mode 100644 index df8d17c..0000000 Binary files a/evolutionapi/models/__pycache__/profile.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/__init__.cpython-310.pyc b/evolutionapi/services/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 7282ee2..0000000 Binary files a/evolutionapi/services/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/call.cpython-310.pyc b/evolutionapi/services/__pycache__/call.cpython-310.pyc deleted file mode 100644 index 19d8af9..0000000 Binary files a/evolutionapi/services/__pycache__/call.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/chat.cpython-310.pyc b/evolutionapi/services/__pycache__/chat.cpython-310.pyc deleted file mode 100644 index c96137d..0000000 Binary files a/evolutionapi/services/__pycache__/chat.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/group.cpython-310.pyc b/evolutionapi/services/__pycache__/group.cpython-310.pyc deleted file mode 100644 index addc901..0000000 Binary files a/evolutionapi/services/__pycache__/group.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/instance.cpython-310.pyc b/evolutionapi/services/__pycache__/instance.cpython-310.pyc deleted file mode 100644 index 92ccdb8..0000000 Binary files a/evolutionapi/services/__pycache__/instance.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/instance_operations.cpython-310.pyc b/evolutionapi/services/__pycache__/instance_operations.cpython-310.pyc deleted file mode 100644 index e2e0ebb..0000000 Binary files a/evolutionapi/services/__pycache__/instance_operations.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/label.cpython-310.pyc b/evolutionapi/services/__pycache__/label.cpython-310.pyc deleted file mode 100644 index fea0ce2..0000000 Binary files a/evolutionapi/services/__pycache__/label.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/message.cpython-310.pyc b/evolutionapi/services/__pycache__/message.cpython-310.pyc deleted file mode 100644 index 5918b50..0000000 Binary files a/evolutionapi/services/__pycache__/message.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/__pycache__/profile.cpython-310.pyc b/evolutionapi/services/__pycache__/profile.cpython-310.pyc deleted file mode 100644 index 43cdd90..0000000 Binary files a/evolutionapi/services/__pycache__/profile.cpython-310.pyc and /dev/null differ diff --git a/evolutionapi/services/message.py b/evolutionapi/services/message.py index 79efaae..661d691 100644 --- a/evolutionapi/services/message.py +++ b/evolutionapi/services/message.py @@ -10,13 +10,10 @@ class MessageService: def send_text(self, instance_id: str, message: TextMessage, instance_token: str): # Preparar os dados como JSON - data = { - 'number': message.number, - 'text': message.text - } + data = {} - if hasattr(message, 'delay') and message.delay is not None: - data['delay'] = message.delay + # Add all additional kwargs to data dictionary + data.update(message.__dict__) # Usar o método post do cliente que já trata JSON corretamente return self.client.post(