Discord Plugin
Last updated
Was this helpful?
Last updated
Was this helpful?
Crypto.com AI Agent SDK Discord plugin allows users to create interactive blockchain experiences within Discord communities. By setting up a custom bot, users can interact with the Cronos network using natural language to access wallet data, track transactions, and execute commands directly in server channels.
This guide provides step-by-step instructions to get your Discord bot up and running in no time.
A video demo is available in .
Python installed (version >= 3.12)
Click on "New Application", enter a name for your bot (e.g., CryptoHelper), and click "Create".
In the left sidebar, select "Bot", then click "Add Bot" and confirm by clicking "Yes, do it!"
Under the "Token" section, click "Click to Reveal Token" to view your bot's token.
Copy and securely store this token (e.g., MTM3Mjc0MjI3MzUzNTcwNTE5MA.GHuA_M.dSXMKfwfXxd1kWZ8fBPLvB7EwuWcM6StENS43g
). Never share this token publicly, as it grants control over your bot
In the Developer Portal, navigate to the "OAuth2" section and select "URL Generator".
Under "Scopes", check the boxes for "bot" and "applications.commands".
Under "Bot Permissions", select the permissions your bot needs (e.g., "Send Messages", "Read Message History").
Copy the generated URL at the bottom of the page.
Paste the URL into your browser, select the server you want to add the bot to, and click "Continue".
Review the permissions and click "Authorize".
Complete any CAPTCHA verification if prompted.
Add Discord plugin when initializing the Agent:
As shown in the example code, we start the Discord bot by invoking the Agent's built-in function:
Once the bot is running, test it to ensure it’s working as expected:
Ensure your bot is running and connected to Discord.
Open Discord and navigate to the server where you've added your bot.
Interact with the bot and observe if it responds appropriately to confirm it's functioning correctly.
If you encounter issues during setup or execution, follow these tips:
Check your API keys to ensure they are correctly set in the environment variables.
Review Discord Bot API limitations to ensure compliance with rate limits and usage guidelines.
installed.
API Key for or
API Keys of AI provider, refer to the to see which providers are supported by the AI Agent SDK.
Required account: .
Open your browser and navigate to the .