whatsapp-api-client-python

This library helps you easily create a python application with WhatsApp API

OTHER License

Downloads
45.9K
Stars
115
Committers
12

Bot releases are hidden (Show)

whatsapp-api-client-python - Fixed JSONDecodeError Latest Release

Published by Amele9 7 months ago

Fixes

  • Fixed #49

Enhancements

  • Added helpful links
whatsapp-api-client-python - Added GetAuthorizationCode method

Published by Amele9 11 months ago

Fixes

  • Fixed logger

Enhancements

  • Updated python-package.yml

Features

  • Added time to logs
  • Added links to docs
  • Added GetAuthorizationCode method (thanks to @Jibek100)

Example:

greenAPI.account.getAuthorizationCode(11001234567)
whatsapp-api-client-python - Added new methods

Published by Amele9 11 months ago

Fixes

  • Fixed workflows
  • Fixed UploadFile method logging

Enhancements

  • Updated docs
  • Updated examples
  • Updated tests

Features

  • Added Python 3.12 support
  • Added GetWaSettings method (thanks to @andreyMalyshkin)

Example:

greenAPI.sending.getWaSettings()
  • Added SendPoll method (thanks to @Jibek100)

Example:

greenAPI.sending.sendPoll(
    "[email protected]",
    "Please choose a color:",
    [
        {"optionName": "Red"},
        {"optionName": "Green"},
        {"optionName": "Blue"}
    ]
)
whatsapp-api-client-python - Added logger

Published by Amele9 about 1 year ago

Fixes

  • Fixed webhook connection

Enhancements

  • Updated examples

Features

  • Added debug mode

    In debug mode you can see data received from the Green API. To enable debug mode, add debug_mode option with True value

greenAPI = API.GreenAPI(
    "", "", debug_mode=True
)
  • Added raise_errors option

    If the option is enabled, it will be raised when an error is received

greenAPI = API.GreenAPI(
    "", "", raise_errors=True
)
whatsapp-api-client-python - Fixed ReadTimeout error

Published by Amele9 about 1 year ago

  • Fixed ReadTimeout error
whatsapp-api-client-python - Fixed uploadFile

Published by Amele9 over 1 year ago

  • Fixed uploadFile
whatsapp-api-client-python - Added media host

Published by Amele9 over 1 year ago

  • Added media host
whatsapp-api-client-python - Added UploadFile method

Published by Amele9 over 1 year ago

  • Added UploadFile method
  • Updated python version
  • Updated webhook
  • Updated tests
whatsapp-api-client-python - Updated docs and examples

Published by Amele9 over 1 year ago

  • Updated docs
  • Updated examples
whatsapp-api-client-python - Bump requests from 2.30.0 to 2.31.0

Published by Amele9 over 1 year ago

  • Added badges
  • Improved tests
  • Updated workflows
  • Fixed E711, E712, F401
  • Bump requests from 2.30.0 to 2.31.0
whatsapp-api-client-python - Added method GetMessage

Published by Amele9 over 1 year ago

  • Added method GetMessage
  • Updated category Account
  • Updated category Sending
  • Updated setup.py
  • Added linkPreview parameter to SendMessage method
whatsapp-api-client-python - v.0.0.34 Stable

Published by olegius88 over 1 year ago

whatsapp-api-client-python - v.0.0.33 Stable

Published by olegius88 over 1 year ago

whatsapp-api-client-python - Stable

Published by olegius88 over 1 year ago

whatsapp-api-client-python - v.0.0.31 Stable

Published by ripreal over 1 year ago

whatsapp-api-client-python - v.0.0.30 API and Webhook updates

Published by olegius88 almost 2 years ago

Add ForwardMessages method

whatsapp-api-client-python - v.0.0.29 API and Webhook updates

Published by ripreal almost 2 years ago

Добавил класс GreenAPIError. Он вызывается, когда происходит ошибка (status_code != 200). Его можно обработать таким образом:

try:
    greenAPI.request("GetSettings")
except GreenAPIError as error:
    print(error.error_message)

Добавил GET HTTP метод, как метод по умолчанию.
Мелкие исправления и улучшения

Обновил Webhook класс. Теперь он называется Bot. И хранится этот класс в директории bot. Его можно импортировать вместе с GreenAPI классом:

from whatsapp_api_client_python import GreenAPI, Bot

Теперь можно использовать функции-декораторы. При получении нового уведомления данные отправятся в ту функцию, которая декорируется.
При использовании декоратора handler, нужно указать type_webhook. Пример:

@bot.handler("stateInstanceChanged")
def handler(body: dict):
    print(body["instanceData"])
    print("stateInstanceChanged")

При использовании декоратора message, можно указать текст сообщения в чате WhatsApp, на который нужно ответить (если не указывать, функция будет получать все входящие сообщения). Если функция возвращает строку, то она автоматически будет отправлена в тот же чат. Пример:

@bot.message("Привет")
def message(body: dict) -> str:
    print(body["senderData"])
    print("incomingMessageReceived")

    return f"""Привет, {body["senderData"]["senderName"]}"""

Если в чате написать сообщение Привет, то бот отправит это сообщение: Привет, <имя пользователя WhatsApp>.

Обновил setup.py. Теперь все пакеты библиотеки добавляются автоматически, исключая пакет тестов.

whatsapp-api-client-python - v.0.0.28 stable refactor

Published by ripreal almost 2 years ago

Refactoring that removes breaking changes prior 0.0.27

whatsapp-api-client-python - v.0.0.27 revert

Published by ripreal almost 2 years ago

Back to stable 0.0.23

whatsapp-api-client-python - v.0.0.24 Refactor

Published by ripreal almost 2 years ago

The release contains breaking changes

Улучшил импорты. Класс GreenApi переименовал в GreenAPI. Все API категории теперь property функции с подсказками типов (type hints). Улучшил функцию request (также добавил подсказки типов (typing)).

Обновлено:
Улучшил Response класс. Обновил инициализацию пакета (Теперь можно сразу импортировать GreenAPI класс). Также обновил тесты (unittest).

Package Rankings
Top 9.5% on Pypi.org
Badges
Extracted from project README
Support Support Support Guides News News
Related Projects