Skip to main content
Get started with developing the Streamer Alerts Bot by setting up your local environment.

Prerequisites

Required:
  • Node.js version 18.0.0 or higher
  • npm, yarn, or pnpm package manager
  • Git for version control
  • Discord bot token (create one here)

Installation

1

Clone the repository

Clone the repository and navigate to the project directory:
git clone https://github.com/BankkRoll/streamer-alerts-discord-bot.git
cd streamer-alerts-discord-bot
2

Install dependencies

Install the required dependencies using your preferred package manager:
npm install
The bot uses discord.js v14 and requires Node.js 18+ to run properly.
3

Configure environment variables

Copy the example environment file and add your Discord bot token:
cp .env.example .env
Edit .env and add your Discord bot token:
.env
DISCORD_TOKEN=your_token_here
4

Deploy slash commands

Register the bot’s slash commands with Discord:
npm run deploy
This script deploys the following commands:
  • /streamer add - Add a streamer to track
  • /streamer remove - Remove a tracked streamer
  • /streamer list - List all tracked streamers
  • /help - Interactive help menu
  • /ping - Check bot latency

Development Commands

The project includes several npm scripts for development:
CommandDescription
npm run devRun the bot with hot reload using tsx watch
npm run buildCompile TypeScript to JavaScript in dist/
npm startStart the compiled bot from dist/index.js
npm run typecheckType-check without emitting files
npm run lintLint TypeScript files with ESLint
npm run formatFormat code with Prettier
npm run deployDeploy slash commands to Discord

Running the Bot

Development Mode

For active development with automatic reloading:
npm run dev
This uses tsx watch to automatically restart the bot when you make changes to the source code.

Production Mode

For running the built version:
npm run build
npm start

Project Structure

The bot follows a modular TypeScript architecture:
src/
├── commands/          # Slash command definitions
├── events/            # Discord.js event handlers
├── platforms/         # Platform checker implementations
│   ├── index.ts      # Platform registry
│   ├── kick.ts       # Kick platform checker
│   ├── twitch.ts     # Twitch platform checker
│   ├── youtube.ts    # YouTube platform checker
│   ├── rumble.ts     # Rumble platform checker
│   └── tiktok.ts     # TikTok platform checker
├── services/          # Core services (polling, database)
├── types/             # TypeScript type definitions
└── utils/             # Helper functions

TypeScript Configuration

The project uses strict TypeScript settings for type safety:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Node",
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true
  }
}
The project uses ES modules ("type": "module" in package.json). Make sure to use .js extensions in your imports even though you’re writing TypeScript.

Next Steps

Adding Platforms

Learn how to add support for new streaming platforms

Contributing

Read the contributing guidelines and best practices

Build docs developers (and LLMs) love