Skip to content

Repository files navigation

Botrix

Your bot. Your control. Chat, manage, and monitor your Discord bot locally with a clean, powerful interface.

Features

  • Chat Panel: Send messages as your bot to selected Discord channels
  • Channel Selector: Browse and select guilds and text channels
  • Live Logs: Real-time bot event monitoring
  • Command Sender: Send bot commands (like !ping)
  • Multi-bot Support: Manage multiple bots from local configurations
  • Settings Panel: Enter bot tokens directly in the app UI
  • Discord OAuth: Secure user authentication to protect data
  • Modern UI: Clean dark theme with sidebar navigation
  • Security: Tokens stored securely and never exposed

Setup

Quick Start (Recommended)

# Fix any setup issues automatically
npm run fix

# Install dependencies
npm install

# Run diagnostic to check everything
npm run diagnose

# Start the app
npm start

Automated Setup Scripts

Windows:

setup-windows.bat

macOS/Linux:

chmod +x setup-unix.sh
./setup-unix.sh

These scripts will automatically install dependencies, fix common issues, and run diagnostics.

Manual Setup

  1. Install Dependencies:

    npm install
  2. Configure Your Bot (Choose one method):

    Method 1: File-based (Recommended for security)

    • Create a new folder in config/ for your bot (e.g., config/my-bot/)
    • Copy the .env file from config/example-bot/ to your bot's folder
    • Edit the .env file and replace your_bot_token_here with your actual Discord bot token

    Method 2: UI-based (Convenient but less secure)

    • Launch the app
    • Click the ⚙️ settings button in the sidebar
    • Enter your bot token and name in the settings panel
    • Click "Save Bot Configuration"
  3. Get Discord Bot Token:

    • Go to Discord Developer Portal
    • Create a new application
    • Go to the "Bot" section
    • Copy the token and paste it in your .env file or settings panel
    • Go to Discord Developer Portal
    • Create a new application
    • Go to the "Bot" section
    • Copy the token and paste it in your .env file
  4. Invite Bot to Server:

    • In the Discord Developer Portal, go to "OAuth2" > "URL Generator"
    • Select bot scope and appropriate permissions (at minimum: Send Messages, Read Message History)
    • Use the generated URL to invite the bot to your server

Troubleshooting

If you encounter errors, try these solutions:

Run the Diagnostic Tool

npm run diagnose

Run the Quick Fix Tool

npm run fix

Common Issues

  • "Cannot find module" errors: Run npm install
  • "Authentication failed": Check your bot token is correct
  • "Missing permissions": Re-invite bot with proper permissions
  • "Port already in use": Kill process on port 3000 or use different port

For detailed troubleshooting, see TROUBLESHOOTING.md

  1. Run the Application:
    npm start

Installation

Desktop (PC/Mac/Linux)

Download the latest release from the Releases page:

  • Windows: Download the .exe installer
  • macOS: Download the .dmg file
  • Linux: Download the .AppImage file

Run the installer and follow the setup instructions.

Mobile (Native Apps)

Download APK/IPA files from the Releases page:

  • Android: Download the .apk file and install on your device
  • iOS: Download the .ipa file and install via Xcode/TestFlight

Or build from source (see below).

Building from Source

Prerequisites

  • Node.js 16+
  • npm

Setup Icons (Optional)

Add app icons to assets/ folder:

  • icon.ico (Windows)
  • icon.icns (macOS)
  • icon.png (Linux)

And PWA icons to public/:

  • icon-192.png
  • icon-512.png

Build Steps

# Clone the repository
git clone https://github.com/Neuliko/botrix.git
cd botrix

# Install dependencies
npm install

# Build for your platform
npm run build

# Or build for specific platforms
npm run build:win    # Windows
npm run build:mac    # macOS
npm run build:linux  # Linux

# For mobile native apps
npm run mobile:init
npm run mobile:add:android  # Add Android platform
npm run mobile:add:ios      # Add iOS platform (macOS only)
npm run mobile:build        # Build and sync to native projects
npm run mobile:android      # Open Android Studio
## Building EXE Installer

### Automated Build Scripts

**PowerShell Script (Recommended):**
```powershell
# Run the automated build script
.\build-exe.ps1

Batch File (Alternative):

build-exe.bat

Manual PowerShell Commands

If you prefer to run commands manually, here's the complete sequence:

# 1. Check Node.js and npm
node --version
npm --version

# 2. Clean previous builds
Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force build -ErrorAction SilentlyContinue

# 3. Install dependencies
npm install

# 4. Run diagnostics (optional but recommended)
npm run diagnose

# 5. Build Windows EXE
npm run build:win

# 6. Check build output
Get-ChildItem dist

Individual Commands Breakdown

Command 1: Check Prerequisites

# Verify Node.js is installed
node --version

# Verify npm is installed
npm --version

# Check if you're in the right directory
Get-Location

Command 2: Clean Previous Builds

# Remove old build files
Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force build -ErrorAction SilentlyContinue

Command 3: Install Dependencies

# Install all required packages
npm install

Command 4: Run Diagnostics (Optional)

# Check for configuration issues
npm run diagnose

Command 5: Build the EXE

# Build Windows installer
npm run build:win

Command 6: Verify Build

# List created files
Get-ChildItem dist

# Check file sizes
Get-ChildItem dist | Select-Object Name, @{Name="Size(MB)";Expression={[math]::Round($_.Length/1MB,2)}}

Build Output

After successful build, you'll find these files in the dist folder:

  • Local Bot Client Setup X.X.X.exe - Windows installer (recommended)
  • Local Bot Client X.X.X.exe - Portable version
  • Other build artifacts

Installation

  1. Go to the dist folder
  2. Run Local Bot Client Setup X.X.X.exe
  3. Follow the installation wizard
  4. Botrix will be installed and available in your Start Menu

Troubleshooting Build Issues

Issue: "electron-builder not found"

npm install

Issue: "Windows Build Tools required"

npm install -g windows-build-tools

Issue: "Permission denied"

# Run PowerShell as Administrator, then:
Start-Process powershell -Verb RunAs

Issue: "Build fails with strange errors"

# Clear npm cache and reinstall
npm cache clean --force
npm install

Build Requirements

  • Node.js 18+
  • npm
  • Windows 10+ (for building Windows executables)
  • Administrator privileges (recommended)
  • Internet connection (for downloading dependencies)

Alternative Build Methods

Build for current platform only:

npm run build

Build for all platforms (requires cross-compilation setup):

npm run dist

Build portable version:

npm run build:win
# The portable .exe will be in dist folder
├── main.js              # Electron main process
├── capacitor.config.js   # Capacitor configuration
├── public/              # Web assets for PWA and mobile
│   ├── index.html       # Main UI
│   ├── styles.css       # Styles
│   ├── renderer.js      # UI logic
│   ├── manifest.json    # PWA manifest
│   └── sw.js           # Service worker
├── android/             # Android project (generated)
├── ios/                 # iOS project (generated)
├── config/              # Bot configurations
│   └── example-bot/
│       └── .env         # Bot token and settings
├── .github/             # GitHub Actions
│   └── workflows/
│       └── release.yml  # Automated releases
└── dist/                # Build output (generated)

Security Features

  • Token Security: Bot tokens are stored encrypted and never displayed in the UI
  • OAuth Authentication: Connect your Discord account for secure access control
  • Data Protection: All sensitive data is stored locally and never transmitted
  • Secure IPC: Electron context isolation prevents token exposure
  • Environment Variables: File-based tokens use secure environment loading

Development

For development with auto-reload:

npm run dev

Requirements

  • Node.js 16+
  • Discord bot token with appropriate permissions
  • Bot invited to at least one Discord server

About

Your bot. Your control. Chat, manage, and monitor your Discord bot locally with a clean, powerful interface.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages