Skip to content

HLVM04/roblox-discord-stat-bot

Repository files navigation

Roblox Stats Discord Bot

A Discord bot that tracks Roblox game player counts in voice channel names.

Features

  • Track multiple Roblox games across different Discord servers
  • Auto-updates player counts every 6 minutes
  • Custom display formats - personalize how player counts are shown
  • Creates or uses existing voice channels
  • Caches API requests to avoid redundant calls when multiple channels track the same game

Setup

Local Development

  1. Install Go 1.25.5 or higher
  2. Copy .env.example to .env and add your bot token:
    cp .env.example .env
  3. Run the bot:
    go run main.go

Docker Deployment

Using Docker Compose (Recommended)

  1. Create a .env file with your bot token:

    BOT_TOKEN=your_discord_bot_token_here
    DEBUG=false
  2. Start the bot:

    docker-compose up -d
  3. View logs:

    docker-compose logs -f
  4. Stop the bot:

    docker-compose down

Using Docker Directly

  1. Build the image:

    docker build -t roblox-stat-bot .
  2. Run the container:

    docker run -d \
      --name roblox-stat-bot \
      -e BOT_TOKEN=your_token_here \
      -v $(pwd)/config.json:/app/config.json \
      --restart unless-stopped \
      roblox-stat-bot

Commands

All /track commands require the "Manage Channels" permission.

  • /track add <universe_id> [channel] [channel_display] - Start tracking a game
    • universe_id - The Roblox Universe ID (required)
    • channel - Existing voice channel to use (optional, creates new if not provided)
    • channel_display - Custom display format using %d for player count (optional, default: 🎮 Playing: %d)
      • Examples: Players: %d, 🔥 %d online, Active: %d players
  • /track remove <channel> - Stop tracking a channel
    • Deletes the channel if created by bot
    • Restores original name if using existing channel
  • /track list - Show all tracked games in the server
  • /track update - Force update all channels in the server
  • /help - Show help information about the bot (no permissions required)

Configuration

The bot stores its configuration in config.json. This file persists tracker data and is automatically managed by the bot.

Environment Variables

  • BOT_TOKEN - Your Discord bot token (required)
  • DEBUG - Enable debug logging (optional, default: false)

About

A Discord bot that tracks Roblox game player counts in voice channel names.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors