Skip to main content
This tutorial walks through creating a Discord application, generating a bot token, and enabling the required privileged intent. ollim-bot runs entirely in DMs — no server invite is needed.

Prerequisites

1

Create a Discord application

Go to the Discord Developer Portal and click New Application. Give it a name (e.g. ollim-bot) and click Create.Note the Application ID on the General Information page.
2

Create a bot and copy the token

In the left sidebar, click Bot. Uncheck Public Bot (ollim-bot is single-user — no one else needs to install it). Click Reset Token (or Add Bot if prompted), then copy the token.Add it to your .env file:
.env
DISCORD_TOKEN=MTE5...your-token
The token is shown only once. If you lose it, you must reset it to generate a new one.
3

Enable the Message Content intent

On the same Bot page, scroll down to Privileged Gateway Intents. Enable Message Content Intent.ollim-bot requires this intent to read message content in DMs. The bot initialization enables it explicitly:
intents = discord.Intents.default()
intents.message_content = True
Without this intent enabled, the bot cannot see what you type.
4

Configure user installation

In the left sidebar, click Installation.
  1. Under Installation Contexts, check User Install (uncheck Guild Install — ollim-bot doesn’t use servers)
  2. Set the install link to Discord Provided Link
  3. Under Default Install Settings for the user install context, add the applications.commands scope
This lets you install the app directly to your Discord account so slash commands work in DMs without a shared server.
5

Install the app to your account

Copy the Install Link shown on the Installation page and open it in your browser. Select Add to my apps to install the bot to your Discord account.
Bookmark the install link — you’ll need it again if you re-create the application.
6

Configure remaining environment variables

In addition to DISCORD_TOKEN, ollim-bot requires two more environment variables:
.env
DISCORD_TOKEN=MTE5...your-token
OLLIM_USER_NAME=YourName
OLLIM_BOT_NAME=ollim
VariableRequiredDescription
DISCORD_TOKENYesBot token from step 2
OLLIM_USER_NAMEYesYour display name
OLLIM_BOT_NAMEYesThe bot’s name
If either OLLIM_USER_NAME or OLLIM_BOT_NAME is missing, the bot exits immediately with an error.
7

Start the bot

ollim-bot
Required environment variables are validated at import time (before the bot starts). Once running, the bot:
  1. Checks that no other instance is running (via PID file at ~/.ollim-bot/state/bot.pid)
  2. Connects to Discord and syncs slash commands
  3. Sends you a startup DM
  4. Starts the scheduler and webhook server (if configured)
You should see output like:
ollim online as ollim#1234
synced 9 slash commands
Send a DM to your bot to verify it responds.

Slash commands

Once the bot is online, these slash commands are available:
CommandDescription
/clearReset conversation history
/compactCompress conversation context
/costShow token usage for the session
/modelSwitch model (opus, sonnet, haiku)
/thinkingToggle extended thinking (on, off)
/forkStart a forked conversation
/interruptStop the current response
/permissionsSet permission mode
/ping-budgetView or configure ping budget

Next steps