Home / Blog / How to make a Discord bot: custom bot with or without code

← Back to Blog

How to make a Discord bot: custom bot with or without code

VaultCord TeamHow we write10 min read
Dark cover with a plain bot head shape inside a rounded panel, connected to a small server panel by a green line.

To make a Discord bot, create an application in the Discord Developer Portal, add a bot to it and copy its token, invite it to your server with an install link, then run code that connects it to Discord on a computer that stays online. If you would rather not write or host code, turn that same application into a custom bot with VaultCord: paste its token and client secret, and VaultCord keeps it online 24/7 under your bot’s name, with verification, slash commands, and plain-English plugins, plus VaultCord’s server backups.

This is for a server owner who wants a bot with their own name on it. The part people get wrong is the token: it is the bot’s password, and anyone who has it controls the bot.

What is a Discord custom bot?

A custom bot is a Discord bot that runs on your own application, so it shows your bot’s name and profile instead of a shared public bot’s. Everything it does comes from the code behind it: code you write, or code a service runs for you.

Every bot, custom or public, is set up the same way in Discord’s Developer Portal.

Step 1: Create an application

  1. Open the Discord Developer Portal and sign in.
  2. Press New Application, give it a name, and accept Discord’s terms.
  3. Optional but worth it: create the application under a Developer Team, so more than one trusted person can manage it. Discord requires 2FA on your account to create or join a team.

Step 2: Get the bot token

On the application’s Bot page, press Reset Token under Token to create a bot token, and copy it somewhere safe. Discord’s guide warns:

Make sure to never share your token or check it into any kind of version control.

Discord also says you cannot view the token again unless you reset it. The same page has privileged intents, such as reading message content. Leave them off unless your bot needs them; Discord says they must be approved before an app is verified.

Step 3: Invite the bot to your server

  1. Open the application’s Installation page and select Guild Install under Installation Contexts.
  2. Under Install Link, select Discord Provided Link.
  3. In Default Install Settings, add the scopes bot and applications.commands for Guild Install, and pick only the permissions the bot needs. Avoid Administrator, which lets a bot do anything in your server.
  4. Open the install link, choose your server, and press Authorize.

The bot now shows in your member list, offline, until something runs it.

Step 4: Give the bot something to do

A bot is only online while code connected to Discord is running. Discord’s guide builds one in JavaScript with Node.js: it registers slash commands, then answers them when members use them. Libraries such as discord.js and discord.py handle the connection for you.

The catch is hosting. The code has to keep running on a computer or server that is always on. If it stops, the bot goes offline. You also have to keep the token secret on that machine and update the code when Discord changes its API.

If you want to code, follow Discord’s Building your first Discord Bot from here. If you do not, the next section skips this step entirely.

Make a custom bot without code

VaultCord runs your application as a custom bot for you, so there is nothing to host. Custom bots are unlimited on every plan, and Online Bot 24/7 is included on Free.

  1. Create the application and copy the bot token, as in steps 1 and 2.
  2. In the VaultCord dashboard, add a bot and paste the bot token, then the client secret from the application’s OAuth2 page.
  3. In the application’s OAuth2 settings, press Add Redirect, paste https://vaultcord.win/auth, and press Save Changes.
  4. Invite the bot to your server with the link VaultCord gives you. It does not ask for Administrator.
  5. In the bot’s settings, set the Bot Name, the Online Status, and an Activity Type: Playing, Streaming, Listening to, Watching, or Competing in. Turn on Live on Discord.

Your bot now runs VaultCord’s features under your name:

  • Verification with captcha, account age, and scammer checks free, and alt and VPN checks on Premium. Discord OAuth2 verification covers the setup.
  • Slash commands such as /verify-embed, /pull, and /backup, admin-only by default. Backups themselves run on VaultCord’s own backup bot.
  • Member restore: members who verify through your bot can be added back to a server later. How to pull members on Discord explains it.

How it works

  1. 1Create the application

    In Discord’s Developer Portal, with a bot token and client secret.

  2. 2Add it to VaultCord

    Paste the token and secret, add the redirect URL, and invite the bot.

  3. 3Name it and add features

    Set its name and status, then turn on verification and plugins. VaultCord keeps it online.

Add features with plugins

Plugins add your own features to the bot. In your server’s settings, press Build Bot Features to make one, or pick a ready-made one from the plugin library.

  • They run on verification events: when a member completes verification, gets blocked, starts, or lets the session expire.
  • They can act in plain English. Write an instruction such as “give this member the Event Team role”, and the plugin carries it out on that server. Destructive actions such as bans only happen when the instruction asks for them.
  • They can run your own code for anything more, with every run and Discord action recorded in the plugin’s history.
Plugin limitFreePaid plans
Plain-English actions per run16
Characters per instruction1002,000
Plugins per server1010
Discord actions per server30 per minute30 per minute
Run time30 seconds30 seconds

Code it yourself or use VaultCord?

Code it yourselfVaultCord custom bot
HostingYou keep a computer or server runningOnline 24/7, included on Free
What it can doAnything you can codeVerification, slash commands, backups, member restore, and plugins
Skills neededProgramming in JavaScript, Python, or similarNone for the basics
CostYour hostingFree plan, or $4.97 a month for Premium

Code it yourself if the bot is a project in its own right, such as a game or music bot. Use VaultCord if you want a bot with your server’s name that protects the server and can bring members back.

Keep your bot safe

  • Never share the token. If it leaks, press Reset Token on the Bot page right away; the old one stops working.
  • Use a Developer Team, so losing one account does not lose the bot.
  • Do not give the bot Administrator. VaultCord’s own dashboard gives the same advice for custom bots.
  • Turn on 2FA for everyone who can reach the application. How to enable 2FA on Discord shows how.

Frequently asked questions

Is it free to make a Discord bot?

Yes. Creating an application and a bot in the Developer Portal is free. Hosting code costs whatever your server costs; VaultCord runs a custom bot on its free plan.

Can I make a Discord bot without coding?

Yes. Create the application, then paste its token and client secret into VaultCord. It runs the bot with verification, slash commands, and plugins.

What language is best for a Discord bot?

JavaScript with Node.js is what Discord’s own guide uses. Python is also common.

How do I keep my Discord bot online 24/7?

Run its code on a server that never sleeps, or let a service run it. VaultCord includes Online Bot 24/7 on every plan.

Can I change my bot’s name and status?

Yes. In VaultCord, set the Bot Name, Online Status, and Activity Type in the bot’s settings. In the Developer Portal you can also change its name and avatar.

Sources and verification

Discord’s documentation and VaultCord’s current code were read on the dates shown.

Keep reading

More guides for running a Discord server you can restore.