Metadata-Version: 2.4
Name: elizaos-plugin-discord
Version: 2.0.0a5
Summary: Discord plugin for elizaOS - Python implementation
Project-URL: Homepage, https://github.com/elizaos/eliza
Project-URL: Documentation, https://elizaos.ai/docs
Project-URL: Repository, https://github.com/elizaos/eliza
Project-URL: Issues, https://github.com/elizaos/eliza/issues
Author: elizaOS Contributors
License-Expression: MIT
Keywords: agent,ai,bot,discord,elizaos
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: discord-py>=2.3.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest-xprocess>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Provides-Extra: voice
Requires-Dist: pynacl>=1.5.0; extra == 'voice'
Description-Content-Type: text/markdown

# elizaOS Discord Plugin (Python)

Python implementation of the Discord plugin for elizaOS agents.

## Installation

```bash
pip install elizaos-plugin-discord
```

For voice support:

```bash
pip install elizaos-plugin-discord[voice]
```

## Quick Start

```python
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

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

# Run tests
pytest

# Type checking
mypy elizaos_plugin_discord

# Linting
ruff check elizaos_plugin_discord
```

## License

MIT
