mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-07-13 15:14:48 -06:00
refactor: improve message sending by dynamically handling message attributes
This commit is contained in:
parent
82c0ad0363
commit
c838eb8311
11
README.md
11
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
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user