Integration guide

Chat & CollaborationProprietary platform with developer APIsUpdated 2026

Discord Bots Integration

Discord developer APIs for bots that can surface AI helpers, moderation flows, and community support actions.

IntermediateSetup
PartialLocal runtime
3Related paths

Recommended path

Discord Bots local AI quick start

  1. 1. Create the bot and request only needed intentsCreate a Discord application, add its bot user, enable MESSAGE_CONTENT only if the design truly needs ordinary message text, and invite it with the narrowest permissions.
  2. 2. Run the bot beside a reachable model endpointStart the bot process on the same machine or network as Ollama or another local API, keep the endpoint private, and verify the bot can receive an interaction.
  3. 3. Handle one command from event to replyBegin with a mention or slash command, validate and trim its input, call the local model, and send the response. Add moderation or server actions only after the reply path is reliable.

Best for

Communities and builders adding bot-driven assistance or moderation inside Discord servers.

Model support

Discord provides no model integration. You write a bot with discord.py or discord.js, and that process calls your local endpoint, so the model support is entirely whatever your backend implements.

Choose models by role

Community answers

Phi-4 Mini

A compact instruction model keeps routine replies responsive on modest hardware. Ground it with retrieved community material when factual accuracy matters.

Open the model profile →

Moderation and server actions

Tool-capable model with human review

Use a model with structured output or tool calling for action proposals, but require human approval before bans, deletions, role changes, or other consequential operations.

How to use this integration

  • Run a community assistant on your own hardware with no per-message API cost
  • Answer questions from a local knowledge base inside a private server
  • Moderate or triage messages with a local classifier before anything reaches a vendor
  • Prototype a conversational bot against a model you can swap without changing billing

Connecting a local model

Run the bot process on the same machine or network as the model and call the local API from your event handler. There is no Discord-side endpoint configuration.

Tradeoffs

The constraint that surprises people is a permission, not a model detail: MESSAGE_CONTENT is a privileged intent, and without it a bot receives empty message content except in DMs, when mentioned, for its own messages, or through message context-menu commands. Unverified apps can enable it in the Developer Portal; verified apps, which Discord requires when an app reaches 100 or more guilds, must be approved for the intent. discord.js additionally requires Node.js 24.17.0 or newer.

Source

Discord Gateway docs