Skip to main content

Zalo Personal Account plugin for elizaOS - Python implementation via zca-cli

Project description

elizaOS Plugin: Zalo User (Python)

Zalo Personal Account integration for elizaOS agents via zca-cli.

Overview

This plugin enables elizaOS agents to interact with Zalo personal accounts using the zca-cli tool. It supports:

  • QR code login flow
  • Direct messages (DMs) and group messages
  • Multi-profile support
  • Friend and group listing
  • Media sending (images, links)

Prerequisites

You must have zca-cli installed:

npm install -g zca-cli

Then authenticate with your Zalo account:

zca auth login

Installation

pip install elizaos-plugin-zalouser

Configuration

Set the following environment variables:

Variable Description Required
ZALOUSER_ENABLED Enable/disable the plugin No (default: true)
ZALOUSER_DEFAULT_PROFILE Default zca profile to use No (default: default)
ZALOUSER_COOKIE_PATH Path to cookie file for auth persistence No
ZALOUSER_IMEI IMEI for authentication No
ZALOUSER_USER_AGENT User agent for API requests No
ZALOUSER_PROFILES JSON config for multiple profiles No
ZALOUSER_ALLOWED_THREADS JSON array or comma-separated list of allowed thread IDs No
ZALOUSER_DM_POLICY DM policy: open, allowlist, pairing, disabled No (default: pairing)
ZALOUSER_GROUP_POLICY Group policy: open, allowlist, disabled No (default: disabled)
ZALOUSER_LISTEN_TIMEOUT Listen timeout in ms No (default: 30000)

Usage

from elizaos_plugin_zalouser import ZaloUserService, ZaloUserConfig, SendMessageParams

# Create config
config = ZaloUserConfig.from_env()

# Create and start service
service = ZaloUserService(config)
await service.start()

# Send a message
result = await service.send_message(
    SendMessageParams(
        threadId="123456789",
        text="Hello from elizaOS!",
    )
)

# List friends
friends = await service.list_friends()

# List groups
groups = await service.list_groups()

# Stop service
await service.stop()

License

MIT

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_zalouser-2.0.0a4.tar.gz (16.9 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_zalouser-2.0.0a4-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for elizaos_plugin_zalouser-2.0.0a4.tar.gz
Algorithm Hash digest
SHA256 c66ca34ef14cccac309e0e996361389d6d2d2a6d7f6eb7916de608db8298ac6b
MD5 6885accf7f82eb323810cc88f8258450
BLAKE2b-256 56f14381876ab728b9b1b07132b6ad991e9344290fe054302d9c978c2203dac8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elizaos_plugin_zalouser-2.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 80bf06fa56502362693226705582cb5a827164789e02e7eb5b39b5f82b2ec900
MD5 88a2a272a41cf28f85ac35bf9802f0b1
BLAKE2b-256 f4c995c384b17834280b89c33c97d2f88b0bb4d4293a6f110e2b23abbe482569

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