Library โ€บ Your own AI assistant

Set up your own Discord server and bot

Free Updated 2026-10-20

You'll end up with a private server, your own bot inside it, and the bot's token saved safely.

  • โฑ About 15 minutes
  • ๐Ÿ’ป Easiest on a computer
  • ๐Ÿ”‘ A password manager for one secret

Create the server

  1. In Discord, click + at the bottom of the server list.
  2. Create My Own โ†’ For me and my friends.
  3. Type a name, then click Create.

Clicking +, Create My Own, naming the server and clicking Create

Your new server is open, with a #general channel.

Turn on Developer Mode and copy two IDs

  1. User Settings (gear, bottom left) โ†’ type Developer in the search box โ†’ Developer โ†’ Developer Mode on.
  2. Right-click your server icon โ†’ Copy Server Info โ†’ Copy Server ID. Paste it in your notes.
  3. Show the member list (people icon, top right) โ†’ right-click your name โ†’ Copy User ID. Paste it too.

Turning on Developer Mode, then copying the server ID and your user ID

Two long numbers (18โ€“19 digits) in your notes.

Create the bot

  1. Open the Developer Portal โ†’ New Application โ†’ name it โ†’ tick the terms box โ†’ Create. If Discord asks "Are you human?", tick the box.

    Creating a new application in the Developer Portal

  2. Bot (left menu) โ†’ turn on Message Content Intent โ†’ Save Changes.

  3. Installation โ†’ Install Link: None โ†’ Save Changes.

  4. Bot โ†’ turn off Public Bot โ†’ Save Changes.

Message Content Intent on, Install Link set to None, Public Bot off

"Bot successfully updated!" with Public Bot off.

Step 3 matters: Discord refuses to make a bot private while it still has an install link.

Copy the token

  1. On the Bot page, click Reset Token โ†’ Yes, do it!
  2. Enter your Discord password (or a 2FA code) if asked.
  3. Copy the token straight into your password manager. (Keeping it in a file? Run chmod 600 on it.)

Reset Token and the confirmation

"A new token was generated!" and the token is saved somewhere only you can open.

It's the bot's password. Never paste it into a chat, screenshot or shared file. Leaked? Reset it again.

Invite the bot

  1. OAuth2 โ†’ OAuth2 URL Generator โ†’ Scopes: tick bot.
  2. Bot Permissions: View Channels, Send Messages, Send Messages in Threads, Read Message History, Attach Files, Add Reactions. (Using the layout kit? Add Manage Roles and Manage Channels.)
  3. Copy the Generated URL at the bottom, open it โ†’ pick your server โ†’ Continue โ†’ Authorize.

Ticking bot and its permissions, then authorizing it into the server

Your channel shows "โ€ฆ has added your bot to the server."

Make a Member role

  1. Server name โ†’ Server Settings โ†’ Roles โ†’ Create Role.
  2. Name it Member, pick a color โ†’ Save Changes.
  3. Manage Members โ†’ Add Members โ†’ tick yourself โ†’ Add.

Creating the Member role and adding yourself to it

In the role list, your bot's role is above Member, and Member has 1 member. If not, drag the bot's role above it.

Add a private channel

  1. Right-click an empty part of the channel list โ†’ Create Category โ†’ Members โ†’ Private Category on โ†’ Next.
  2. Tick the Member role and your bot โ†’ Create Category.
  3. Click + next to Members โ†’ name it assistant โ†’ Create Channel.

Creating a private category for Members and a channel inside it

#assistant has a lock, and says "This is the start of the #assistant private channel."

Connect your AI assistant

Give the token to your assistant and set who may talk to it (your User ID from step 2).

The bot's dot turns green and it answers you in #assistant.

Trouble?

  • "Private application cannot have a default authorization link": set Installation โ†’ Install Link to None first (step 3).
  • "Invalid token" / 401 / close code 4004: the token was reset or mistyped. Copy a fresh one (step 4).
  • Bot sees empty messages: Message Content Intent is off (step 3).
  • Close code 4014: the program wants an intent you didn't turn on. Turn on the one it names.
  • 403 / "Missing Permissions" (50013): check the channel's permissions and that the bot's role is above Member.
  • "Missing Access" (50001): add the bot to the private category (step 7).
  • 429 Too Many Requests: the program is going too fast. Good ones wait and retry.

Recorded on 2026-10-20 against Discord's current menus. If a button moved, look for the bold words, or see Discord's developer docs.

Sources