Skip to main content

Overview

This guide will walk you through creating a Discord bot application, configuring permissions, and obtaining your bot token to run the Streamer Alerts Bot.
Never share your bot token with anyone. Treat it like a password - it gives full control over your bot.

Prerequisites

  • A Discord account
  • A Discord server where you have administrator permissions
  • Node.js installed (v18 or higher)

Creating Your Bot Application

1

Access Discord Developer Portal

Navigate to the Discord Developer Portal and sign in with your Discord account.
2

Create New Application

Click the New Application button in the top-right corner.
Give your application a name (e.g., “Streamer Alerts”). You can change this later.
3

Navigate to Bot Section

In the left sidebar, click on Bot to access the bot settings.If you haven’t created a bot yet, click Add Bot and confirm.
4

Configure Bot Settings

Under the bot settings, configure the following:
  • Username: Set your bot’s display name
  • Icon: Upload a profile picture (optional)
  • Public Bot: Toggle OFF if you only want to add it to your own servers
5

Enable Required Intents

Scroll down to Privileged Gateway Intents and enable:
  • SERVER MEMBERS INTENT (required for guild operations)
  • MESSAGE CONTENT INTENT (required for message handling)
These intents are required for the bot to function properly. Without them, certain features will not work.
6

Copy Bot Token

Under the TOKEN section, click Reset Token (or Copy if you haven’t reset it).Save this token securely - you’ll need it for the next section.
You can only view the token once. If you lose it, you’ll need to reset it again.

Configuring Bot Permissions

The bot requires specific permissions to function:

Required Permissions

  • Send Messages - To send live alerts and command responses
  • Embed Links - To display rich embeds with stream information
  • Use External Emojis - To show platform emojis (🟣 Twitch, 🔴 YouTube, etc.)
  • View Channels - To access channels where alerts will be posted
Users need Manage Channels permission to add or remove streamers using /streamer add and /streamer remove commands.

Inviting the Bot to Your Server

1

Navigate to OAuth2

In the Discord Developer Portal, go to OAuth2 > URL Generator in the left sidebar.
2

Select Scopes

Under SCOPES, select:
  • bot
  • applications.commands
3

Select Permissions

Under BOT PERMISSIONS, select:
  • ✅ Send Messages
  • ✅ Embed Links
  • ✅ Use External Emojis
  • ✅ View Channels
4

Copy Invite URL

Copy the generated URL at the bottom of the page.
5

Invite to Server

Paste the URL in your browser, select your server, and click Authorize.

Installing and Running the Bot

1

Clone or Download the Bot

Download the bot source code to your machine.
2

Install Dependencies

Open a terminal in the bot directory and run:
npm install
3

Configure Environment

Create a .env file in the root directory:
cp .env.example .env
Open .env and add your bot token:
DISCORD_TOKEN=your_token_here
Replace your_token_here with the actual token you copied earlier.
4

Deploy Slash Commands

Register the bot’s slash commands with Discord:
npm run deploy
You only need to run this once, or whenever you update the bot’s commands.
5

Start the Bot

Run the bot:
npm start
For development with hot reload:
npm run dev
6

Verify Bot is Online

Check your Discord server - the bot should now appear online!Test it with /ping to verify it’s responding to commands.

Next Steps

Adding Streamers

Learn how to add streamers and configure alerts

Managing Alerts

Manage your streamer list and notifications

Keeping the Bot Running 24/7

For production use, consider hosting your bot on:
  • VPS (DigitalOcean, Linode, AWS EC2)
  • Cloud Platforms (Heroku, Railway, Render)
  • Process Managers (PM2, systemd)
Use PM2 to keep your bot running automatically:
npm install -g pm2
pm2 start npm --name "streamer-bot" -- start
pm2 save
pm2 startup

Build docs developers (and LLMs) love