mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-07-13 15:14:48 -06:00
readme
This commit is contained in:
parent
6a5ca36377
commit
6d2e240722
36
README.md
36
README.md
@ -1,6 +1,6 @@
|
|||||||
# Evolution Client Python
|
# Evolution Client Python
|
||||||
|
|
||||||
Client Python para interagir com a API Evolution.
|
Client Python para interagir com a API evolutionapi.
|
||||||
|
|
||||||
## Instalação
|
## Instalação
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ pip install evolutionapi
|
|||||||
### Inicializando o Cliente
|
### Inicializando o Cliente
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from evolution.client import EvolutionClient
|
from evolutionapi.client import EvolutionClient
|
||||||
|
|
||||||
client = EvolutionClient(
|
client = EvolutionClient(
|
||||||
base_url='http://seu-servidor:porta',
|
base_url='http://seu-servidor:porta',
|
||||||
@ -30,7 +30,7 @@ instances = client.instances.fetch_instances()
|
|||||||
|
|
||||||
#### Criar Nova Instância
|
#### Criar Nova Instância
|
||||||
```python
|
```python
|
||||||
from evolution.models.instance import InstanceConfig
|
from evolutionapi.models.instance import InstanceConfig
|
||||||
|
|
||||||
config = InstanceConfig(
|
config = InstanceConfig(
|
||||||
instanceName="minha-instancia",
|
instanceName="minha-instancia",
|
||||||
@ -55,7 +55,7 @@ estado = client.instance_operations.get_connection_state(instance_id, instance_t
|
|||||||
|
|
||||||
#### Definir Presença
|
#### Definir Presença
|
||||||
```python
|
```python
|
||||||
from evolution.models.presence import PresenceStatus
|
from evolutionapi.models.presence import PresenceStatus
|
||||||
|
|
||||||
client.instance_operations.set_presence(
|
client.instance_operations.set_presence(
|
||||||
instance_id,
|
instance_id,
|
||||||
@ -68,7 +68,7 @@ client.instance_operations.set_presence(
|
|||||||
|
|
||||||
#### Mensagem de Texto
|
#### Mensagem de Texto
|
||||||
```python
|
```python
|
||||||
from evolution.models.message import TextMessage
|
from evolutionapi.models.message import TextMessage
|
||||||
|
|
||||||
mensagem = TextMessage(
|
mensagem = TextMessage(
|
||||||
number="5511999999999",
|
number="5511999999999",
|
||||||
@ -81,7 +81,7 @@ response = client.messages.send_text(instance_id, mensagem, instance_token)
|
|||||||
|
|
||||||
#### Mensagem de Mídia
|
#### Mensagem de Mídia
|
||||||
```python
|
```python
|
||||||
from evolution.models.message import MediaMessage, MediaType
|
from evolutionapi.models.message import MediaMessage, MediaType
|
||||||
|
|
||||||
mensagem = MediaMessage(
|
mensagem = MediaMessage(
|
||||||
number="5511999999999",
|
number="5511999999999",
|
||||||
@ -97,7 +97,7 @@ response = client.messages.send_media(instance_id, mensagem, instance_token)
|
|||||||
|
|
||||||
#### Mensagem com Botões
|
#### Mensagem com Botões
|
||||||
```python
|
```python
|
||||||
from evolution.models.message import ButtonMessage, Button
|
from evolutionapi.models.message import ButtonMessage, Button
|
||||||
|
|
||||||
botoes = [
|
botoes = [
|
||||||
Button(
|
Button(
|
||||||
@ -125,7 +125,7 @@ response = client.messages.send_buttons(instance_id, mensagem, instance_token)
|
|||||||
|
|
||||||
#### Mensagem com Lista
|
#### Mensagem com Lista
|
||||||
```python
|
```python
|
||||||
from evolution.models.message import ListMessage, ListSection, ListRow
|
from evolutionapi.models.message import ListMessage, ListSection, ListRow
|
||||||
|
|
||||||
rows = [
|
rows = [
|
||||||
ListRow(
|
ListRow(
|
||||||
@ -161,7 +161,7 @@ response = client.messages.send_list(instance_id, mensagem, instance_token)
|
|||||||
|
|
||||||
#### Criar Grupo
|
#### Criar Grupo
|
||||||
```python
|
```python
|
||||||
from evolution.models.group import CreateGroup
|
from evolutionapi.models.group import CreateGroup
|
||||||
|
|
||||||
config = CreateGroup(
|
config = CreateGroup(
|
||||||
subject="Nome do Grupo",
|
subject="Nome do Grupo",
|
||||||
@ -174,7 +174,7 @@ response = client.group.create_group(instance_id, config, instance_token)
|
|||||||
|
|
||||||
#### Atualizar Foto do Grupo
|
#### Atualizar Foto do Grupo
|
||||||
```python
|
```python
|
||||||
from evolution.models.group import GroupPicture
|
from evolutionapi.models.group import GroupPicture
|
||||||
|
|
||||||
config = GroupPicture(
|
config = GroupPicture(
|
||||||
image="base64_da_imagem"
|
image="base64_da_imagem"
|
||||||
@ -185,7 +185,7 @@ response = client.group.update_group_picture(instance_id, "grupo_jid", config, i
|
|||||||
|
|
||||||
#### Gerenciar Participantes
|
#### Gerenciar Participantes
|
||||||
```python
|
```python
|
||||||
from evolution.models.group import UpdateParticipant
|
from evolutionapi.models.group import UpdateParticipant
|
||||||
|
|
||||||
config = UpdateParticipant(
|
config = UpdateParticipant(
|
||||||
action="add", # ou "remove", "promote", "demote"
|
action="add", # ou "remove", "promote", "demote"
|
||||||
@ -199,7 +199,7 @@ response = client.group.update_participant(instance_id, "grupo_jid", config, ins
|
|||||||
|
|
||||||
#### Atualizar Nome do Perfil
|
#### Atualizar Nome do Perfil
|
||||||
```python
|
```python
|
||||||
from evolution.models.profile import ProfileName
|
from evolutionapi.models.profile import ProfileName
|
||||||
|
|
||||||
config = ProfileName(
|
config = ProfileName(
|
||||||
name="Novo Nome"
|
name="Novo Nome"
|
||||||
@ -210,7 +210,7 @@ response = client.profile.update_profile_name(instance_id, config, instance_toke
|
|||||||
|
|
||||||
#### Atualizar Status
|
#### Atualizar Status
|
||||||
```python
|
```python
|
||||||
from evolution.models.profile import ProfileStatus
|
from evolutionapi.models.profile import ProfileStatus
|
||||||
|
|
||||||
config = ProfileStatus(
|
config = ProfileStatus(
|
||||||
status="Novo status"
|
status="Novo status"
|
||||||
@ -221,7 +221,7 @@ response = client.profile.update_profile_status(instance_id, config, instance_to
|
|||||||
|
|
||||||
#### Configurar Privacidade
|
#### Configurar Privacidade
|
||||||
```python
|
```python
|
||||||
from evolution.models.profile import PrivacySettings
|
from evolutionapi.models.profile import PrivacySettings
|
||||||
|
|
||||||
config = PrivacySettings(
|
config = PrivacySettings(
|
||||||
readreceipts="all",
|
readreceipts="all",
|
||||||
@ -239,7 +239,7 @@ response = client.profile.update_privacy_settings(instance_id, config, instance_
|
|||||||
|
|
||||||
#### Verificar Números WhatsApp
|
#### Verificar Números WhatsApp
|
||||||
```python
|
```python
|
||||||
from evolution.models.chat import CheckIsWhatsappNumber
|
from evolutionapi.models.chat import CheckIsWhatsappNumber
|
||||||
|
|
||||||
config = CheckIsWhatsappNumber(
|
config = CheckIsWhatsappNumber(
|
||||||
numbers=["5511999999999", "5511888888888"]
|
numbers=["5511999999999", "5511888888888"]
|
||||||
@ -250,7 +250,7 @@ response = client.chat.check_is_whatsapp_numbers(instance_id, config, instance_t
|
|||||||
|
|
||||||
#### Marcar Mensagem como Lida
|
#### Marcar Mensagem como Lida
|
||||||
```python
|
```python
|
||||||
from evolution.models.chat import ReadMessage
|
from evolutionapi.models.chat import ReadMessage
|
||||||
|
|
||||||
mensagem = ReadMessage(
|
mensagem = ReadMessage(
|
||||||
remote_jid="5511999999999@s.whatsapp.net",
|
remote_jid="5511999999999@s.whatsapp.net",
|
||||||
@ -265,7 +265,7 @@ response = client.chat.mark_message_as_read(instance_id, [mensagem], instance_to
|
|||||||
|
|
||||||
#### Simular Chamada
|
#### Simular Chamada
|
||||||
```python
|
```python
|
||||||
from evolution.models.call import FakeCall
|
from evolutionapi.models.call import FakeCall
|
||||||
|
|
||||||
config = FakeCall(
|
config = FakeCall(
|
||||||
number="5511999999999",
|
number="5511999999999",
|
||||||
@ -280,7 +280,7 @@ response = client.calls.fake_call(instance_id, config, instance_token)
|
|||||||
|
|
||||||
#### Gerenciar Labels
|
#### Gerenciar Labels
|
||||||
```python
|
```python
|
||||||
from evolution.models.label import HandleLabel
|
from evolutionapi.models.label import HandleLabel
|
||||||
|
|
||||||
config = HandleLabel(
|
config = HandleLabel(
|
||||||
number="5511999999999",
|
number="5511999999999",
|
||||||
|
Loading…
Reference in New Issue
Block a user