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 channelsend_dm- Send a direct message to a useradd_reaction- Add a reaction to a message
Providers
channel_state- Current channel informationvoice_state- Voice channel stateguild_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)
| File | Size | Uploaded | |
|---|---|---|---|
| elizaos_plugin_discord-2.0.0a5.tar.gz | 32.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|