Skip to content

Getting started

How to make a Discord bot with AI, without coding

A step by step guide to creating your own Discord bot: describe it, let AI write the discord.js code, create the bot in the Developer Portal and run it.

· Updated · 7 min read
Cover image: How to make a Discord bot with AI, without coding

You can have your own Discord bot without writing the code yourself. An AI writes the program from your description, you create the bot account in Discord, and you run the project on a computer or a host. This guide shows the whole path, in the order you will do it.

What a Discord bot is

A bot is a program that logs into Discord with a token and then reacts to things: slash commands that members type, buttons they click, members joining, messages being posted. Because it is a program, it needs two things: code and a place to run while it is online. Public bots such as the ones in the big lists are run by their authors. A bot of your own is yours to run.

Step 1: decide what the bot should do

Start with one clear job. "A ticket system with a button" is a good first bot. "A bot that does everything" is not. Write down the commands members will type, who may use them and what should happen. A useful description has four parts:

  • The commands or events that start things, for example /warn or a member joining.
  • What the bot does in plain words, including limits such as a cooldown or a maximum number.
  • Who is allowed to do it: everyone, a role, or members with a permission.
  • Where messages go: which channel, which embed style, which texts.

Step 2: generate the code

Paste the description into BotsMaker and press Create bot. The AI writes a discord.js v14 project: index.js, a deploy script for the slash commands, one file per command, event handlers and a config file for the texts. Then the project is tested: every file is parsed, the bot is started with a pretend login and each slash command is executed once. If a test fails, the error is sent back to the AI, which repairs the code. You get the result with a short summary and the list of intents the bot needs.

Step 3: create the bot in Discord

  1. Open the Discord Developer Portal and click New Application.
  2. On the Bot tab, copy the token. Treat it like a password.
  3. On the same tab, switch on any privileged intent the summary names, such as Server Members.
  4. Copy the Application ID. It is the CLIENT_ID of the bot.

The guide on tokens and invites shows these screens one by one.

Step 4: invite it to your server

In the Developer Portal open OAuth2, then URL Generator. Tick the scopes bot and applications.commands, choose the permissions the bot needs, and open the link. You will be asked which server to add it to. You need the Manage Server permission there.

Step 5: run it

npm install
cp .env.example .env      # fill in DISCORD_TOKEN and CLIENT_ID
npm run deploy            # registers the slash commands
npm start

Use your own server id in GUILD_ID while you test, because commands registered for one server show up immediately. When the bot works, remove it to register the commands everywhere.

Step 6: keep it online

The bot only answers while the program is running. For a bot that must be online all day, use a small VPS, a Docker container, a Pterodactyl panel or another host for Node.js. The hosting guide compares the options.

Step 7: change it by chatting

When you want a change, write it in the chat of the project, for example "add a /remindme command" or "give the role at level 20". The AI changes the existing code instead of starting from scratch, and earlier versions are kept so you can go back.

Written by

BotsMaker Team

We build BotsMaker, the AI Discord bot creator. The guides come from what we see when bots are generated, tested and set up in the Discord Developer Portal and on real hosts.

More guides

RSS feed · All guides