Skip to content

Latest commit

 

History

History
118 lines (94 loc) · 2.19 KB

SETUP.md

File metadata and controls

118 lines (94 loc) · 2.19 KB

Detailed Setup Guide for PUBGpal Bot

Prerequisites

  1. Node.js Installation

    • Download from nodejs.org
    • Required version: 16.x or higher
    • Verify installation:
      node --version
      npm --version
  2. Discord Developer Account

    • Go to Discord Developer Portal
    • Click "New Application"
    • Navigate to "Bot" section
    • Create a new bot
    • Copy the token
    • Enable necessary Privileged Gateway Intents:
      • Presence Intent
      • Server Members Intent
      • Message Content Intent
  3. PUBG API Key

Installation Steps

  1. Clone Repository

    git clone https://github.com/Ryggs/pubg-stats-bot.git
    cd pubg-stats-bot
  2. Install Dependencies

    npm install
  3. Configure Environment

    cp .env.example .env
    # Edit .env with your tokens
  4. Setup Database (Optional)

    npm run setup-db
  5. Verify Installation

    npm run verify

Bot Configuration

  1. Discord Bot Settings

    • Enable required privileged intents in Discord Developer Portal
    • Generate invite URL with required permissions
    • Add bot to your server
  2. Environment Variables

    DISCORD_TOKEN=your_discord_token
    PUBG_API_KEY=your_pubg_api_key
    NODE_ENV=development
    LOG_LEVEL=info
  3. Command Registration

    npm run register-commands

Running the Bot

  1. Development Mode

    npm run dev
  2. Production Mode

    npm start

Updating the Bot

  1. Pull Latest Changes

    git pull origin main
  2. Update Dependencies

    npm install
  3. Run Migrations (if any)

    npm run migrate

Security Considerations

  1. Token Security

    • Never commit tokens to git
    • Rotate tokens regularly
    • Use environment variables
  2. Rate Limiting

    • Implement cooldowns on commands
    • Respect PUBG API limits
    • Monitor usage patterns