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:
🚀 Quick Start with Docker (Recommended)
The fastest way to get started is using Docker Compose:
-
Clone the repository
git clone https://github.com/The-Running-Dev/BarStrad-Bot.git
cd BarStrad-Bot -
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 -
Start the bot
docker-compose up -d
-
Verify the bot is running
docker-compose logs bot
🛠️ Manual Installation
For development or custom setups:
-
Clone and install dependencies
git clone https://github.com/The-Running-Dev/BarStrad-Bot.git
cd BarStrad-Bot
npm install -
Set up environment variables
Create a
.env
file:DiscordBotToken=your_discord_bot_token_here
DiscordWebhookUrl=your_discord_webhook_url_here
NODE_ENV=development -
Build the project
npm run build
-
Start the bot
npm start
For development with hot reload:
npm run dev
Discord Bot Setup
Step 1: Create Discord Application
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section in the left sidebar
- Click "Add Bot"
- 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
- Go to the "OAuth2" section in your Discord application
- Select "bot" under scopes
- Select the required permissions
- Copy the generated URL and open it in your browser
- Select your server and authorize the bot
Step 4: Create Webhook (Optional)
For order notifications:
- Go to your Discord server settings
- Navigate to "Integrations" → "Webhooks"
- Click "New Webhook"
- Configure the webhook for your desired channel
- Copy the webhook URL for your
.env
file
Verification
After setup, test your bot:
-
Check bot status
Look for this message in your logs:
✅ Logged in as YourBotName#1234
-
Test basic commands
In your Discord server, try:
!menu
-
Test ordering
Try placing a test order:
!order 1 Test User
Next Steps
Now that your bot is running:
- Customize the menu - Add your own items and categories
- Configure notifications - Set up order notifications
- Learn bot commands - Explore all available commands
- Set up development environment - If you want to contribute
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 runningnpm install
again - TypeScript errors: Check for syntax errors in any modified files
Need more help? Check out our Troubleshooting Guide or open an issue.