Blue Bots
  • Intro
  • Basics
    • Installation
    • Configuration
    • Useful Sites
  • Bugs & Support
    • Requesting Support
  • Premade Bots
    • Invoice Bot
      • Creating a PayPal application
      • Managing Webhooks
      • PayPal Developer Dashboard
    • Application Bot
Powered by GitBook
On this page
  • Creating the bot application
  • Gateway Intents
  • Dependencies
  • Running the bot 24/7
  • PM2
  • Bot Host
  • Inviting the bot to your server

Was this helpful?

  1. Basics

Installation

PreviousIntroNextConfiguration

Last updated 2 months ago

Was this helpful?

Creating the bot application

  1. While logged in, head to the .

  2. Click the "New Application" button and name it the name of your bot.

  3. Click the "Bot" button from the sidebar, and click "Add Bot".

  4. Now that you have created a bot, you may change its username and icon. Click the "Click to Reveal Token" button or the "Copy" button to get your bot's token.

  5. Rename example.env to .env All of your bot and client secrets will be stored here (don't share it with anybody!)

  6. After renaming the file, add the token and client id to the .env file. It should end up looking something like this:

    DISCORD_TOKEN=YOUR_BOT_TOKEN
    CLIENT_ID=YOUR_BOT_CLIENT_ID
    DEPLOY_SLASH_COMMANDS=true

Gateway Intents

Dependencies

Dependencies are located in the package.json file and can be installed by running npm i while in the bot's directory. If you are missing your package.json file, please contact me directly.

All of my current bots require a newer version of NodeJS (I've tested them on 18.20.3)!

Running the bot 24/7

PM2

The following steps assume that you have NodeJS already installed.

  1. Navigate to wherever you unpacked the bot and proceed to the next step.

  2. While in the bot's root directory, execute npm i. This will install the dependencies needed for the bot to run.

    The following steps are for pm2. If you are using another manager, please follow their docs. If you don't already have a bot account, refer to the "Creating the bot application" section

  3. Follow the pm2 docs to get the bot running 24/7

Bot Host

Refer to your host's documentation on how to set up a Discord bot. The bot's main file/entry point is dist/index.js

Inviting the bot to your server

After creating your Discord application and bot user, navigate to the OAuth2 page. Under scopes, click the "bot" checkbox AND "Use Slash Commands." After that, all you need to do is navigate to the generated URL and invite the bot to your server as normal.

Some bots may require access to and process data from certain "privileged" parts of the API and you may need to enable Gateway Intents. You may enable them as shown below with the .

Install a process manager such as . We will use this to run the bot 24/7.

Discord Developer Portal
pm2
Discord Developer Portal
Discord Applications
OAuth2 Page