-
Node.js Installation
- Download from nodejs.org
- Required version: 16.x or higher
- Verify installation:
node --version npm --version
-
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
-
PUBG API Key
- Visit PUBG Developer Portal
- Create an account
- Generate an API key
-
Clone Repository
git clone https://github.com/Ryggs/pubg-stats-bot.git cd pubg-stats-bot
-
Install Dependencies
npm install
-
Configure Environment
cp .env.example .env # Edit .env with your tokens
-
Setup Database (Optional)
npm run setup-db
-
Verify Installation
npm run verify
-
Discord Bot Settings
- Enable required privileged intents in Discord Developer Portal
- Generate invite URL with required permissions
- Add bot to your server
-
Environment Variables
DISCORD_TOKEN=your_discord_token PUBG_API_KEY=your_pubg_api_key NODE_ENV=development LOG_LEVEL=info
-
Command Registration
npm run register-commands
-
Development Mode
npm run dev
-
Production Mode
npm start
-
Pull Latest Changes
git pull origin main
-
Update Dependencies
npm install
-
Run Migrations (if any)
npm run migrate
-
Token Security
- Never commit tokens to git
- Rotate tokens regularly
- Use environment variables
-
Rate Limiting
- Implement cooldowns on commands
- Respect PUBG API limits
- Monitor usage patterns