Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

elizaOS Discord Plugin (Python)

Python implementation of the Discord plugin for elizaOS agents.

Installation

pip install elizaos-plugin-discord

For voice support:

pip install elizaos-plugin-discord[voice]

Quick Start

import asyncio
from elizaos_plugin_discord import DiscordConfig, DiscordService

async def main():
    # Load config from environment
    config = DiscordConfig.from_env()

    # Create and start the service
    service = DiscordService(config)

    # Set up event handler
    @service.on_message
    async def handle_message(message):
        print(f"Received: {message.content}")

    # Start the bot
    await service.start()

asyncio.run(main())

Configuration

Set the following environment variables:

Variable Required Description
DISCORD_API_TOKEN Yes Bot token from Discord Developer Portal
DISCORD_APPLICATION_ID Yes Application ID from Discord Developer Portal
CHANNEL_IDS No Comma-separated list of channel IDs to monitor
DISCORD_SHOULD_IGNORE_BOT_MESSAGES No Ignore messages from other bots (default: true)
DISCORD_SHOULD_IGNORE_DIRECT_MESSAGES No Ignore DMs (default: false)
DISCORD_SHOULD_RESPOND_ONLY_TO_MENTIONS No Only respond when mentioned (default: false)

Actions

  • send_message - Send a message to a channel
  • send_dm - Send a direct message to a user
  • add_reaction - Add a reaction to a message

Providers

  • channel_state - Current channel information
  • voice_state - Voice channel state
  • guild_info - Server/guild information

Development

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

# Run tests
pytest

# Type checking
mypy elizaos_plugin_discord

# Linting
ruff check elizaos_plugin_discord

License

MIT

Metadata

Release files for elizaos-plugin-discord 2.0.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elizaos-plugin-discord 2.0.0a5
File Size Uploaded
elizaos_plugin_discord-2.0.0a5.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elizaos-plugin-discord 2.0.0a5
File Interpreter ABI Platform
elizaos_plugin_discord-2.0.0a5-py3-none-any.whl Python 3 none any Details

Total release size: 77.9 kB

Release files / elizaos_plugin_discord-2.0.0a5.tar.gz

Download URL elizaos_plugin_discord-2.0.0a5.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a482d3cab3fc1be17cfa38384286fd122cf814a142bb2ef99a44a85a4a3d0f39
BLAKE2b-256 checksum
How to use checksums
e4c460cc754f990034a7f41aed2033e0b5158d3b64f710a89f64b845fea8b726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / elizaos_plugin_discord-2.0.0a5-py3-none-any.whl

Download URL elizaos_plugin_discord-2.0.0a5-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3e37610f4b9521b9644d0a3367beda173e0bdb3204d3ed84be06c9cab28f9be
BLAKE2b-256 checksum
How to use checksums
c2f4d9e398c61d50fecf8e20ce1cf2d60ec6896a73e9cb629c678734b0bcf344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

2.0.0a5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page