Skip to main content

Zalo Official Account Bot API plugin for elizaOS - Python implementation

Project description

elizaos-plugin-zalo (Python)

Python implementation of the Zalo Official Account Bot API plugin for elizaOS.

Installation

pip install elizaos-plugin-zalo

Usage

import asyncio
from elizaos_plugin_zalo import ZaloService, ZaloConfig

async def main():
    # Load config from environment
    config = ZaloConfig.from_env()
    
    # Create and start service
    service = ZaloService(config)
    await service.start()
    
    # Send a message
    message_id = await service.send_message("user_id", "Hello from elizaOS!")
    print(f"Sent message: {message_id}")
    
    # Stop service
    await service.stop()

asyncio.run(main())

Configuration

Set the following environment variables:

  • ZALO_APP_ID - Zalo App ID (required)
  • ZALO_SECRET_KEY - Zalo Secret Key (required)
  • ZALO_ACCESS_TOKEN - OAuth access token (required)
  • ZALO_REFRESH_TOKEN - OAuth refresh token (optional)
  • ZALO_WEBHOOK_URL - Webhook URL (required for webhook mode)
  • ZALO_USE_POLLING - Set to true for polling mode (optional)
  • ZALO_ENABLED - Set to false to disable (optional)
  • ZALO_PROXY_URL - HTTP proxy URL (optional)

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy elizaos_plugin_zalo

# Linting
ruff check elizaos_plugin_zalo
ruff format elizaos_plugin_zalo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elizaos_plugin_zalo-2.0.0a4.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elizaos_plugin_zalo-2.0.0a4-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file elizaos_plugin_zalo-2.0.0a4.tar.gz.

File metadata

  • Download URL: elizaos_plugin_zalo-2.0.0a4.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for elizaos_plugin_zalo-2.0.0a4.tar.gz
Algorithm Hash digest
SHA256 05efc61a4f41b9c46b72f733d825e4667a968ce95a27dbd1203c6ea47d45719a
MD5 5a254adb21e899f8f0452cc4ff62baf4
BLAKE2b-256 87a55d8d671099f61692ad6dfe1a29efeb2426ccf467b1b879abdce2b50ef85a

See more details on using hashes here.

File details

Details for the file elizaos_plugin_zalo-2.0.0a4-py3-none-any.whl.

File metadata

File hashes

Hashes for elizaos_plugin_zalo-2.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 e1cf06e113cec9e3dd72c0851dc28b81720b0fe20705c3373847baf8ed324a12
MD5 b5ab528ae08d99800f8de7bd0b5c4b0a
BLAKE2b-256 5938cedb5ae52f7f725681e8bb5c107483e8ffdc372c0a264aff8a48907e9341

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page