Host a Discord bot 24/7 with your AI agent

Keep a Discord bot online 24/7 without your computer. Paste one paragraph into Claude Code, Codex or Cursor; your agent writes, deploys and checks the bot.

You can have a Discord bot that stays online around the clock, even with your computer switched off. You create the bot in Discord’s Developer Portal, save its key in your aidrop.it project, and paste one paragraph into Claude Code, Codex or Cursor. Your agent writes the bot, puts it online and tells you when to try it. Plan on about 20 minutes.

There are two kinds of Discord bot, and it helps to pick before you start. A classic bot keeps a live connection to Discord, so it sees messages as they are written and can react to them. A slash-command bot only answers commands people type, like /ask, and Discord calls it at a web address. This page builds a classic bot, because that is what most people mean. The slash-command kind is covered in the FAQ.

One honest limit: a bot here cannot join voice channels to talk or play music. Voice uses a kind of connection that cannot leave aidrop.it, which only lets apps reach the internet through ordinary web traffic. Text works fully.

What you will have at the end

  • A bot in your Discord server that shows as online and answers “!ping” with “Pong!”.
  • A bot that keeps running with your computer off and after every update.
  • The bot’s code saved in a repository, so your agent can change it later.

Words you will meet

  • Developer Portal — Discord’s website where you create and configure bots.
  • Bot token — the password of your bot. Anyone who has it can act as your bot.
  • Intent — a permission you switch on in the Developer Portal. Reading the text of messages needs the one called Message Content Intent.
  • Invite link — a link that adds your bot to a server you manage.
  • Secret — a private value, like the token, kept in your aidrop.it project and handed to the bot when it runs. It is never written into the code.
  • Slash command — a command that starts with /, which Discord shows in a menu as people type.

What you need

  • A Discord account and a server where you can add bots.
  • A bot. In the Developer Portal, click New Application and name it. In the Bot section, click Reset Token and copy the token; Discord shows it only once. On the same page, switch on Message Content Intent.
  • The bot in your server. Under OAuth2, URL Generator, tick the bot scope and the permissions to view channels, send messages and read message history. Open the link it makes and choose your server.
  • An aidrop.it account with your agent connected, as in the Quickstart. The smallest plan is enough; this bot needs no database.

Do not paste the token into the chat. Your agent will tell you the exact name to save it under on the Project Secrets page.

Say this to your agent

Say this to your agent
Build me a Discord bot and run it on aidrop.it, 24/7. Use my
existing aidrop.it Project, or create one called "Discord bot"
if I have none.
What it does: it replies "Pong!" when someone writes "!ping" in
a channel it can see. It uses the message content intent, which
I have switched on in the Developer Portal.
How it works:
- Python with discord.py 2.x, as a normal Gateway bot. Do not
use discord.js: its Gateway connection has no proxy option.
- Read aidrop.it's runtime rules before writing code and follow
them. The bot can only reach the internet through the proxy in
HTTPS_PROXY. discord.py does not read it on its own: pass it
as proxy= to the Client, which routes both the Gateway
connection and API calls through it.
- The bot must also serve a small health page on the platform's
port, or aidrop.it treats it as not running. Run the web
server and the bot in the same process.
- Log reconnects, never the token.
Secrets: tell me the exact name to add on the Project Secrets
page for the bot token and wait until I confirm. Never ask me
to paste it into this chat.
Build it, check it runs and shows as online, fix anything that
fails, and tell me when I can type !ping. Report what you
checked.

What your agent does

  1. Picks your aidrop.it project, or creates one.
  2. Tells you the name to save the token under, and waits while you save it.
  3. Writes the bot, plus a small “I’m alive” page that aidrop.it checks to see it is running.
  4. Saves the code to a repository on aidrop.it and builds it there.
  5. Watches the build. If it fails, it reads the error, fixes the code and builds again.
  6. Tells you the bot is online.

Check that it works

  • In your server’s member list, the bot shows as online.
  • Type !ping in a channel the bot can see. It answers “Pong!”.
  • Turn your computer off and try from your phone. It still answers.

When something goes wrong

What you see What to tell your agent
The build finished, but aidrop.it says the app is not running “The bot needs a health page on the platform’s port. Serve one next to the bot and build again.”
The bot never shows as online “The bot cannot reach Discord. Read the logs and make sure the Client gets the proxy.”
The bot is online but ignores !ping Check Message Content Intent is on in the Developer Portal, then tell the agent “Intent is on, restart the bot.”
The logs say the token is invalid Reset the token in the Developer Portal, save the new one in place of the old, then say “build again.”

FAQ

What is a slash-command bot, and should I build one instead?

It is a bot that only answers commands like /ask. Discord sends each command to the bot’s web address and expects an answer within 3 seconds, or a “thinking” reply first (Discord docs). It needs no live connection, so it is simpler to run. The trade-off: it cannot read ordinary messages, see who is online or join voice. Pick it if commands are all you need.

Where do I find my Discord bot token?

In the Developer Portal, open your application, go to Bot and click Reset Token. Discord shows the new token once, so copy it straight away. If a token ever leaks, reset it at once. Then save the new one in place of the old and ask your agent to build the bot again.

Can I make a Discord AI bot that answers with Claude or ChatGPT?

Yes. Ask your agent to send each message, or each /ask command, to the AI model’s API and post the answer. You need an API key from the model’s maker, saved as one more secret.

Is there free Discord bot hosting that runs 24/7?

Discord charges nothing for bots. Keeping one online around the clock needs a server, and that is the part you pay for. On aidrop.it the free plan runs nothing; the smallest plan, Starter, runs a bot like this one, because it needs no database. See aidrop.it for current prices.

Search the docs