Skip to main content

Getting Started

This guide will help you get BarStrad-Bot up and running in minutes.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn
  • Docker (for containerized deployment)
  • Discord Bot Token (from Discord Developer Portal)
  • Discord Webhook URL (for order notifications)

Installation Methods

Choose the installation method that best fits your needs:

The fastest way to get started is using Docker Compose:

  1. Clone the repository

    git clone https://github.com/The-Running-Dev/BarStrad-Bot.git
    cd BarStrad-Bot
  2. Set up environment variables

    Create a .env file in the root directory:

    DiscordBotToken=your_discord_bot_token_here
    DiscordWebhookUrl=your_discord_webhook_url_here
    NODE_ENV=production
  3. Start the bot

    docker-compose up -d
  4. Verify the bot is running

    docker-compose logs bot

🛠️ Manual Installation

For development or custom setups:

  1. Clone and install dependencies

    git clone https://github.com/The-Running-Dev/BarStrad-Bot.git
    cd BarStrad-Bot
    npm install
  2. Set up environment variables

    Create a .env file:

    DiscordBotToken=your_discord_bot_token_here
    DiscordWebhookUrl=your_discord_webhook_url_here
    NODE_ENV=development
  3. Build the project

    npm run build
  4. Start the bot

    npm start

    For development with hot reload:

    npm run dev

Discord Bot Setup

Step 1: Create Discord Application

  1. Go to the Discord Developer Portal
  2. Click "New Application" and give it a name
  3. Go to the "Bot" section in the left sidebar
  4. Click "Add Bot"
  5. Copy the bot token (you'll need this for the .env file)

Step 2: Configure Bot Permissions

Your bot needs the following permissions:

  • Send Messages: To send menu and order confirmations
  • Read Messages: To read user commands
  • Read Message History: To access channel history
  • Use External Emojis: For menu icons (if using custom emojis)

Step 3: Invite Bot to Server

  1. Go to the "OAuth2" section in your Discord application
  2. Select "bot" under scopes
  3. Select the required permissions
  4. Copy the generated URL and open it in your browser
  5. Select your server and authorize the bot

Step 4: Create Webhook (Optional)

For order notifications:

  1. Go to your Discord server settings
  2. Navigate to "Integrations" → "Webhooks"
  3. Click "New Webhook"
  4. Configure the webhook for your desired channel
  5. Copy the webhook URL for your .env file

Verification

After setup, test your bot:

  1. Check bot status

    Look for this message in your logs:

    ✅ Logged in as YourBotName#1234
  2. Test basic commands

    In your Discord server, try:

    !menu
  3. Test ordering

    Try placing a test order:

    !order 1 Test User

Next Steps

Now that your bot is running:

Common Setup Issues

Bot Not Responding

  • Check token: Ensure your Discord bot token is correct
  • Check permissions: Verify the bot has necessary permissions in the server
  • Check status: Look at the console/logs for error messages

Orders Not Working

  • Check webhook URL: Ensure the Discord webhook URL is correct
  • Check channel permissions: Verify the webhook has permissions to send messages
  • Check item numbers: Ensure you're using valid item numbers from the menu

Build Issues

  • Node.js version: Ensure you're using Node.js v18 or higher
  • Dependencies: Try deleting node_modules and running npm install again
  • TypeScript errors: Check for syntax errors in any modified files

Need more help? Check out our Troubleshooting Guide or open an issue.