Discord Bot

The Discord Bot agent serves as an AI assistant for your Discord servers. It uses a global slash command (/ask) to reply to users in your brand’s voice, utilizing dynamic data injection (user name, channel name) to provide personalized, context-aware responses instantly.


Setup (Step-by-Step)

  1. Create Your Application Go to the Discord Developer Portal and click New Application. Give it a name.

  2. Get General Info On the General Information tab, copy the Application ID and Public Key. Paste them into the corresponding inputs on this page.

  3. Create Your Bot Click the Bot tab on the left sidebar.

    • Update your bot's username and icon.

    • Click Reset Token to generate a new bot token. Copy this token and paste it into the Bot Token input on this page.

  4. Write Your Agent Prompt Fill in the prompt template with your bot's persona, rules, and server details.

  5. Test the Output Use the test panel on this page to simulate a command and see the bot's output.

  6. Go Live Click the Start Agent button on this page.

  7. Set Your Webhook Copy the Interactions Endpoint URL provided to you after clicking Start.

    • Go back to the Discord Developer Portal -> General Information tab.

    • Paste the URL into the Interactions Endpoint URL input and click Save Changes.

    • You should see a green success notification from Discord.

  8. Get Your Install Link Click the Installation tab on the left sidebar. Copy the Discord-provided URL.

  9. Install Your Bot Paste the installation URL into your browser. You will be prompted to select a server to install the bot on. You can also give this URL to other server admins.


Configuration

These are the settings located on the left side of the Agent Builder.

Discord Credentials

To connect your agent, you must create an application in the Discord Developer Portal. You will need three pieces of information:

  1. Application ID: Found in the "General Information" tab of your Discord App.

  2. Public Key: Found in the "General Information" tab.

  3. Bot Token: Found in the "Bot" tab (click "Reset Token" to generate one).

Important: After filling these in and clicking Start Agent, we will generate an Interactions Endpoint URL. You must paste this URL back into the "General Information" tab in the Discord Developer Portal to finalize the connection.

Agent Prompt

This is the "brain" of your agent. You can write up to 10,000 characters defining your persona, tone, and rules.

Dynamic Variables: The bot automatically injects context about the request. You can use these to make replies feel personal:

  • [user_global_name]: The display name of the user asking the question.

  • [channel_name]: The specific channel where the command was used.

  • [message_content]: The actual text of the user's question.

Prompt Tip: "Always address the user by their [user_global_name]. If the [channel_name] is #support, keep the tone formal. If it is #general, be more casual."


Testing Your Agent

The panel on the right side allows you to simulate a slash command to see how your prompt handles it before you deploy.

  • User Message: Type a sample question (e.g., "What are the rules for this server?" or "When is the next event?").

  • Test Output: Clicking this allows you to verify that the tone is correct and that the bot is correctly using the dynamic variables.

  • Note: Testing costs 1 credit per output.


Important Notes & Limitations

The /ask Command

This agent is strictly interaction-based. It does not read every message in the chat. Users must type /ask [their question] to trigger a response. This prevents the bot from being spammy and ensures it only speaks when spoken to.

Stateless Memory

Unlike the Telegram bot, this Discord agent is stateless. It treats every /ask command as a new, isolated interaction. It does not "read" previous messages in the channel history. It only knows what is contained in the current prompt and message.

Rate Limits

To prevent abuse, the agent is capped at 500 messages per day per organization.

  • If you need a higher volume for large communities, please contact support.

"Thinking" Indicators

To manage user expectations, the bot immediately sends a "Thinking..." status upon receiving a command. The final AI response is typically posted within 2–5 seconds.

Privacy & Security

Your Application ID, Public Key, and Bot Token are stored securely via Cloudflare KV storage and used only to authenticate requests. We do not store conversation logs, as the bot does not have long-term memory.