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.0a5.tar.gz (14.5 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.0a5-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elizaos_plugin_zalo-2.0.0a5.tar.gz
Algorithm Hash digest
SHA256 b03fd622d63da540592e52546103c14e77454e38f3c1824a7618faa2e4fffa09
MD5 e998ea522d6767e844e16bb78c77aea3
BLAKE2b-256 8ae03ddd602a5d0b77085b941162d066b534ba64b1027d1a964c50a593d5e763

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elizaos_plugin_zalo-2.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 384b16a5c02b13f4419a49fd304fc4bbadf13d1b2fc4df53f12afa29767bfa8e
MD5 5392b5818d54b7a3317f623364367e68
BLAKE2b-256 b05cc015e1acbc940391da809bf2012df0143a9fac884e2ec894ac1836489c95

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