VyroAI

Loading...

Bot Token & Inviting Your Bot

Where the token comes from, how the bot joins your server — and where VyroAI stores it.

Why you need one

VyroAI writes and runs your bot, but Discord will only let it act as your bot if you give it a token. The token is created on Discord's own developer site, not on VyroAI — it is the one step that happens outside the app.

Do this, in order

  1. Create an application on the “Discord Developer Portal”
  2. Add a bot to it and press “Copy token”
  3. In VyroAI, open your bot project in the Code Studio, paste it into the token field in the Bot Console and press “Save Token”
  4. Back on Discord, use the OAuth2 → URL Generator to tick the permissions and build an invite link, then open that link to add the bot to your server

This is the field step 3 means. Drawn from the app's own control list, so it can never go stale like a screenshot.

If Discord says "this integration requires code grant"

The invite link opens, you pick your server, and Discord refuses with This integration requires code grant. Nothing is wrong with your bot or your token.

It is one switch in the Developer Portal. Requires OAuth2 Code Grant is meant for apps that send a person through a login screen and back to a website of their own. A normal bot has no such website, so the switch must be off — with it on, Discord waits for a step that never comes and refuses the invite.

Turning it off and re-inviting

  1. Open your application on the “Discord Developer Portal”
  2. Go to the Bot page and switch Requires OAuth2 Code Grant off, then save
  3. Go to OAuth2 → URL Generator and tick the scopes bot and applications.commands — the second one is what makes your slash commands appear in the server
  4. Tick the permissions your bot actually needs, then open the link it builds at the bottom of the page and pick your server

Privileged intents — the three switches next to the token

On the same Bot page as your token there is a group called Privileged Gateway Intents. Discord keeps three things behind it, because they let a bot see far more than it needs for most jobs:

Turn on only what your bot needs, and remember it has to be asked for in the code as well — the portal grants the permission, the code requests it.

"Used disallowed intents" means one of these is off

If the bot dies the moment it starts and the console prints Used disallowed intents, your code is asking for something the switch has not granted. It is never a token problem, and restarting on its own will not help.

Go to the Bot page, switch on the intent your code asks for, save, then press Start in the Bot Console. The bot is stopped after that error, so there is no Restart button to press — the panel only draws it while a bot is running. If you would rather go the other way — the bot does not really need it — ask the AI in chat to take that intent out of the code.

Saving the token writes it into your project's .env file

This is the part to read twice. Pressing Save Token — or simply clicking out of the token field — writes DISCORD_TOKEN=<your token> into a .env file inside the project, creating that file if there is none, and saves the project to the cloud. Your bot needs it there to log in.

So the token is now part of your project — but not everything that leaves VyroAI carries it any more:

You no longer have to take the token out by hand before a push — the push leaves the whole file behind for you. If a token ever does get out, regenerate it on Discord immediately — the old one dies the moment you do.

A bot token is a password in every other sense too. Never paste it into a chat or a screenshot.

Other secrets — ones your bot does not need on disk — belong in the Secret Vault, and the chat will warn you before you send them to the AI by accident.

Where to next

3 of 10 in Discord Bots · Last checked 17 September 2026 · Previous: Bot Generator