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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for elizaos_plugin_zalouser-2.0.0a5.tar.gz
Algorithm Hash digest
SHA256 f7badc6b3cae8987fe745e61c3a08431bb5af7d8609f089bc9205ac53cc24511
MD5 009e6414c3f65e4c7d969b7c7db851a7
BLAKE2b-256 96c898da66276c3dc2fa7c18bedf2d7aa2db24cd4020a18369fc0b3fee22fe7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elizaos_plugin_zalouser-2.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 89c4c2c2c4e4db13e442656d73cc6a2aa4aa308666c54f37da6ddf6fd7aef755
MD5 5024ba9db8558a8c5df394ca5cd6958c
BLAKE2b-256 6f88c45b1d402f0590f524386c8d0bfd5b576e3e5ec649359d34fc9f60246787

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