Discord plugin for Crypto.com Agent Client
Project description
Crypto.com Agent Plugin – Discord
The Crypto.com Agent Plugin – Discord adds support for Discord bots to the Crypto.com Agent Client ecosystem. This plugin enables conversational agents to operate directly within Discord servers or DMs using the standard Agent SDK lifecycle and plugin architecture.
Features
Discord Integration
- Respond to Discord messages in real-time via bot commands or free-form chat.
- Automatically splits long messages (>2000 characters).
- Uses Discord’s WebSocket gateway and event loop via
discord.py.
Plugin Architecture
- Packaged as a standalone Python plugin.
- Uses Python entry points and PEP 621 standards (
pyproject.toml). - Implements the
AgentPlugininterface withsetup()andrun()lifecycle hooks. - Declares its role as a
primaryplugin — only one such plugin can control the main event loop.
Easy to Install and Extend
- Fully decoupled from the core agent client.
- Compatible with other plugins (e.g., storage, LangFuse, CLI).
- Automatically discovered and initialized by the SDK.
Installation
Install the plugin into your environment:
pip install cryptocom-agent-plugin-discord
Usage
Importing the Plugin
from cryptocom_agent_plugin_discord import DiscordPlugin
Using with the Agent SDK
from cryptocom_agent_client import Agent
from cryptocom_agent_plugin_discord import DiscordPlugin
discord_plugin = DiscordPlugin(bot_token="YOUR_DISCORD_BOT_TOKEN")
agent = Agent.init(
llm_config={...},
blockchain_config={...},
plugins={...},
plugin_instances=[discord_plugin],
)
agent.start()
Plugin Lifecycle
This plugin defines:
mode = "primary"— only one primary plugin is started viaagent.start().setup(handler)— prepares Discord commands and message hooks.run()— starts the asynchronous event loop and Discord bot gateway.- Optional
on_ready(handler)(if needed in future).
Example
from cryptocom_agent_client import Agent
from cryptocom_agent_plugin_discord import DiscordPlugin
discord = DiscordPlugin(bot_token="MTAx...")
agent = Agent.init(
llm_config={
"provider": "OpenAI",
"model": "gpt-4",
"provider-api-key": "sk-...",
},
blockchain_config={
"api-key": "YOUR_SDK_API_KEY",
},
plugins={
"personality": {
"tone": "professional",
"language": "English",
"verbosity": "medium",
},
"instructions": "Answer clearly and briefly.",
},
plugin_instances=[discord],
)
agent.start()
Entry Point Declaration
This plugin is auto-discoverable via pyproject.toml:
[tool.poetry.plugins."crypto_com_agent.plugins"]
discord = "cryptocom_agent_plugin_discord:DiscordPlugin"
This allows the Agent SDK to dynamically discover and initialize your plugin.
File Structure
crypto_com_agent_plugin_discord/
├── __init__.py
└── discord.py # Main plugin implementation
Contributing
We welcome contributions! Please ensure your plugin adheres to the AgentPlugin interface and includes proper setup() and run() hooks.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cryptocom_agent_plugin_discord-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cryptocom_agent_plugin_discord-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faa93b0e97a7133ad870d2927dd75dcf182148c8148c7bf07addb93a2a701fe0
|
|
| MD5 |
06a12221474ee1fe865085b1a2c152de
|
|
| BLAKE2b-256 |
a4b382a0f47d2e28686377c0e487786a2dab01bc371d2b9205e82af9c72d623a
|