Discord Integration Documentation
What the Discord Integration Does
The Discord integration enables interactions with Discord channels and servers. It offers a suite of tools that allow users to perform actions such as sending messages, retrieving channel information, and managing channel content within Discord. This integration is commonly used for automating tasks, building bots, or managing community servers more efficiently.
Example Scenarios
- Sending automated notifications or alerts to a Discord channel.
- Retrieving a list of channels from a server for reporting or documentation.
- Fetching message history for analytics or audit purposes.
Capabilities
What the Integration Enables
- Send Message to Channel: Send a text message to a specified Discord channel.
- Get Channel Information: Retrieve details about a specific channel.
- List Channels: Get a list of all channels within a server.
- Get Channel Messages: Fetch message history from a channel.
- Delete Message: Remove a specified message from a channel.
Input/Output Schemas
-
Send Message to Channel
- Input:
{ "channel_id": 123456789, "message": "Hello, world!" } - Output:
string(Success or error message)
- Input:
-
Get Channel Information
- Input:
{ "channel_id": 123456789 } - Output:
string(JSON string with channel details)
- Input:
-
List Channels
- Input:
{ "guild_id": 987654321 } - Output:
string(JSON string with list of channels)
- Input:
-
Get Channel Messages
- Input:
{ "channel_id": 123456789, "limit": 50 } - Output:
string(JSON string with messages)
- Input:
-
Delete Message
- Input:
{ "channel_id": 123456789, "message_id": 111222333 } - Output:
string(Success or error message)
- Input:
Limitations
The integration is subject to Discord's API rate limits and permissions. Bot operations may be limited based on the server's configuration and permissions granted to the bot.
Setup & Configuration
Prerequisites
- A Discord account.
- A registered bot on Discord with the necessary permissions (e.g., Send Messages, View Channels).
Authentication
- Utilizes a bot token for authentication. This token must be provided during the tool's initialization.
Step-by-step Guide
- Create a new application in the Discord Developer Portal.
- Add a bot to your application and retrieve the bot token.
- Invite your bot to a server using the OAuth2 URL provided in the portal.
- Ensure the bot has the necessary permissions in the server.
Testing Connection
- Verify the bot's activity in a channel by sending a test message.
How to Use in Agents
Example Prompts or Configurations
An agent can be configured to call the Discord integration by specifying the action (e.g., send message) and necessary parameters (e.g., channel ID).
Code Snippet
{
"name": "discord",
"bot_token": "YOUR_DISCORD_BOT_TOKEN"
}
Best Practices
- Ensure proper permissions are set for the bot in the server to allow the desired actions.
- Monitor API usage to avoid hitting rate limits.
Reference Section
- For deeper technical details, refer to Discord's API documentation.
- This integration relies on Discord's API v10 for all operations.