ForgeStore Owner Bot
26 slash commands to manage your store, track revenue, and automate Discord roles — all without leaving Discord.
What the bot does
The ForgeStore Owner Bot connects your ForgeStore store to your game server's Discord community. Once set up in under 5 minutes, it works silently in the background — alerting you to every sale, posting daily performance summaries, and automatically giving players their Discord roles when they purchase.
Installation
Step 1 — Create the Discord Application
- Go to discord.com/developers/applications
- Click New Application → name it ForgeStore
- Under General Information, copy the Application ID — you'll need it later
- Go to Bot → click Add Bot
- Click Reset Token and copy it immediately — it's only shown once
- Scroll down and enable these Privileged Gateway Intents:
- ✅ Server Members Intent (required for auto-roles)
- ✅ Message Content Intent
Step 2 — Invite the bot to your server
- Go to OAuth2 → URL Generator
- Under Scopes: check
botandapplications.commands - Under Bot Permissions, check these:
Permission Why it's needed Send Messages Post sale alerts and summaries Embed Links Show rich embed cards Read Message History Avoid duplicate messages Manage Roles Assign Discord roles after purchases View Channels Access the alert channel - Copy the generated URL → open it → select your server → Authorize
Step 3 — Configure the .env file
DISCORD_TOKEN=your_bot_token_here DISCORD_CLIENT_ID=your_application_id FORGESTORE_URL=https://forgestore.net POLL_INTERVAL=30000 # poll for new sales every 30 seconds EMBED_COLOR=7c3aed # hex color for embeds (no #)
Step 4 — Install, deploy commands, and start
npm install
node src/deploy-commands.js # register slash commands (run once)
npm start
If successful you'll see:
🚀 ForgeStore Owner Bot ready! Logged in as: ForgeStore#1234 Serving 1 servers ⏰ Schedulers started — daily @ 09:00, weekly @ Mon 09:05 🔄 Starting sales polling every 30s
Keep it running (production)
npm install -g pm2 pm2 start src/index.js --name forgestore-bot pm2 save # save process list pm2 startup # auto-start on server reboot
Link Your Store
Before using any other command, link your ForgeStore store to the Discord server.
Get your API key
- Log in to your ForgeStore dashboard
- Go to Store Settings → API
- Copy your API Key and Store ID
Link the store
/link api_key:fs_live_abc123 store_id:1
The bot will test the connection and confirm with your store name and current stats.
Configure your timezone (important)
Set your timezone so daily summaries post at 09:00 your local time, not UTC:
/config timezone tz:Europe/Paris /config timezone tz:America/New_York /config timezone tz:Asia/Tokyo
Set the alert channel
/config alerts channel:#sales-alerts
All sale alerts, daily summaries, goal alerts, stock warnings, and milestone celebrations go to this channel.
All Commands
Type /help in Discord to see the full list anytime.
🔗 Setup
| Command | Description | Permission |
|---|---|---|
/link api_key store_id |
Connect your store to this Discord server. Tests the connection and saves config per guild. | Admin |
/config alerts #channel |
Set the channel for all alerts and automatic summaries. | Admin |
/config timezone tz |
Set your timezone (e.g. Europe/Paris) for scheduled posts. | Admin |
/config status |
Show linked store, alert channel, timezone, and link date. | Admin |
/switch list |
List all your ForgeStore stores with their IDs. | Manage Server |
/switch to store_id |
Switch the active store without re-linking. | Manage Server |
/status |
Full bot health: store name, alert channel, today's revenue, bot uptime, poll interval, active alert preferences. | Everyone |
📊 Statistics
| Command | Description |
|---|---|
/stats [today|7d|30d|all] |
Revenue, orders, unique players, avg order value, conversion rate. Results cached 60s to avoid API spam. |
/revenue [7|30] |
ASCII bar chart of daily revenue over 7 or 30 days. Shows total, daily average, and best day. |
/compare period_a period_b |
Two periods side by side with % change. Today vs Yesterday, This Week vs Last Week, etc. |
/top packages [period] |
Top 10 packages ranked by revenue with sales count. |
/top players [period] |
Top 10 players ranked by total spent with order count. |
/balance |
Available wallet balance, pending, total paid out, and gross revenue. Hidden reply. |
/leaderboard [period] |
Posts a public leaderboard embed visible to all server members. Shows 🥇🥈🥉 for top 3. |
🛒 Orders & Players
| Command | Description |
|---|---|
/sales [limit] [page] |
Recent sales with ◀ ▶ pagination buttons. Shows player, package, amount, and relative timestamp. |
/order <id> |
Full order details: player, package, amount, status, payment method, creation time, delivery time. |
/search <query> |
Search across orders and players in one command. Matches by username, email, or order ID. |
/player <username> |
Full purchase history: total orders, total spent, first purchase date, and last 5 purchases. |
🏪 Store Management
| Command | Description | Permission |
|---|---|---|
/store |
Show store packages with prices and store link. Visible to all server members. Good for a #donations channel. | Everyone |
/package list |
All packages with status (✅/❌), price, and stock remaining. | Manage Server |
/package toggle <id> enabled |
Enable or disable a package instantly. | Manage Server |
/package info <id> |
Full package details: price, type, stock, description. | Manage Server |
/maintenance true|false |
Toggle store maintenance mode — players see a "back soon" page. | Manage Server |
🎟️ Coupons & Discounts
| Command | Description | Permission |
|---|---|---|
/coupon create code discount [uses] |
Create a discount coupon. Code is auto-uppercased. | Manage Server |
/coupon list |
List all active coupons with usage stats. | Manage Server |
/discount player percent [uses] [expires_hours] |
Create a personal coupon for one player. Generates a unique code like NOTCH_20OFF_X7K2. | Manage Server |
🎯 Community Goals
| Command | Description | Permission |
|---|---|---|
/goals |
View all active community goals with live ASCII progress bars and EUR amounts. | Everyone |
/goal create title target [description] |
Create a new community goal directly from Discord. | Manage Server |
/goal list |
List all goals with IDs and progress. | Everyone |
/goal complete <id> |
Mark a goal as reached. | Manage Server |
🎭 Auto-Roles
| Command | Description | Permission |
|---|---|---|
/roles add "keyword" @role |
Map a package keyword to a Discord role. Any package containing the keyword triggers the assignment. | Manage Roles |
/roles list |
See all active package → role mappings for this server. | Manage Roles |
/roles remove "keyword" |
Remove a mapping. | Manage Roles |
/verify <username> |
(Player command) Link their Minecraft/game username to their Discord account for auto-role assignment. | Everyone |
🛡️ Moderation
| Command | Description | Permission |
|---|---|---|
/ban player username [reason] | Ban a player from making purchases on your store. | Manage Server |
/ban unban username | Remove a player's ban — they can purchase again. | Manage Server |
🔔 Alert Preferences
| Command | Description |
|---|---|
/alert config sales daily weekly goals stock milestones | Toggle each alert type individually with true/false. |
/alert status | Show current on/off state for every alert type. |
🎭 Automatic Discord Roles
The bot's most powerful feature. When a player purchases a package, they automatically receive a Discord role — no admin action required.
How it works
Setup (Minecraft example with 4 ranks)
# Map each rank package to a Discord role /roles add "VIP" @VIP /roles add "VIP+" @VIP-Plus /roles add "MVP" @MVP /roles add "Elite" @Elite # Verify your mappings /roles list
/verify Notch
Now when Notch purchases VIP Rank on the store, the bot automatically gives them @VIP in Discord within 30 seconds — and posts a confirmation message.
/roles add "VIP" matches any package whose name contains "VIP" — so it works for "VIP", "VIP Rank", "Monthly VIP", "VIP+", etc. Case-insensitive.Confirmation message
When a role is successfully assigned, the bot posts in the alert channel:
If a player forgets to /verify
Their purchase still goes through and they receive their in-game rank normally via the plugin. They just won't get the Discord role until they run /verify. The role won't be retroactively assigned for past purchases.
🔔 Alerts & Automatic Posts
Once an alert channel is configured, the bot posts automatically without any manual trigger. Each alert type can be individually toggled with /alert config.
Sale alert
Fires within 30 seconds of every completed purchase. The embed color changes based on the amount:
Automatic scheduled posts
| Post | When | Content |
|---|---|---|
| Daily Summary | Every day at 09:00 (local timezone) | Revenue, orders, unique players + 📈/📉 comparison to yesterday |
| Weekly Report | Every Monday at 09:05 | 7-day revenue, % change vs previous week, top package, top player |
| Goal Alert (80%) | When a goal reaches 80% | Goal title, progress bar, prompt to hype the community |
| Goal Complete (100%) | When a goal is fully reached | "Goal Reached!" celebration with the goal title |
| Low Stock Alert | When stock drops to ≤5 units | Package name and remaining stock. Color varies by urgency (🔵 5 → 🟠 3 → 🔴 1) |
🏆 Milestone Celebrations
The bot automatically celebrates your store's growth. Each milestone fires once and is permanently remembered — it will never fire again for that milestone.
Order milestones
| Orders | Message title |
|---|---|
| 1 | 🎉 First Sale!Your very first order just came in. |
| 10 | 🔥 10 Orders!The store is picking up! |
| 50 | 🏅 50 Orders!Your community is growing! |
| 100 | 💯 100 Orders!That's a serious store. |
| 500 | 🏆 500 Orders!You're running a real business. |
| 1,000 | 💎 1,000 Orders!Legendary status 👑 |
Revenue milestones
| Revenue | Message |
|---|---|
| €100 | 💰 €100 Revenue Milestone! |
| €500 | 💰 €500 Revenue Milestone! |
| €1,000 | 💰 €1,000 Revenue Milestone! |
| €5,000 | 💰 €5,000 Revenue Milestone! |
New player alert
When a player makes their very first purchase on your store, the bot posts:
Toggle milestone alerts with /alert config milestones:false.
🔀 Multi-Store Support
If you manage multiple stores, you can switch between them without re-running /link.
/switch list # see all your stores — active one marked with ▶️ /switch to store_id:2 # switch to store 2
Each Discord server can manage a different store. If you run multiple Discord communities, install the bot in each and link a different store in each server.
🎁 Personal Discounts
Create a personalized coupon for a specific player — useful for compensating issues or rewarding loyal supporters.
# 20% off, 1 use, expires in 48 hours /discount player:Notch percent:20 uses:1 expires_hours:48 # 50% off, usable 3 times, 7-day validity /discount player:ProPlayer percent:50 uses:3 expires_hours:168
The bot generates a unique code like NOTCH_20OFF_X7K2. Share it directly with the player. The code is only usable the number of times specified.
⚙️ Configuring Alerts
Toggle individual alert types so your channel only shows what's relevant to you.
/alert config sales:true daily:true weekly:false goals:true stock:false milestones:true
| Alert | Default | What it controls |
|---|---|---|
sales |
ON | Real-time alert on every completed purchase |
daily |
ON | Daily summary at 09:00 local time |
weekly |
ON | Weekly report every Monday at 09:05 |
goals |
ON | Goal progress alerts at 80% and 100% |
stock |
ON | Low stock warnings when ≤5 units remain |
milestones |
ON | Order and revenue milestone celebrations |
🛠️ Troubleshooting
Commands don't appear in Discord
- Make sure you ran
node src/deploy-commands.jsafter setup - Global slash commands can take up to 1 hour to propagate — this is a Discord limitation, not a bot issue
- Check that the bot has Use Application Commands permission in the server
No sale alerts are posting
- Run
/config status— verify the alert channel is set - Check the bot has Send Messages and Embed Links permissions in the alert channel
- Run
/alert status— confirmsalesis ON - Verify your ForgeStore API key in
/config status— re-run/linkif it's changed
Auto-roles aren't being assigned
- The player must have run
/verify TheirUsernamefirst - The bot's role must be above the target roles in Server Settings → Roles
- The bot needs Manage Roles permission
- The package name must contain the keyword (not exact match) — check with
/roles list - Run
/statusto confirm the bot is connected and polling
Daily/weekly summaries are posting at the wrong time
- Set your timezone:
/config timezone tz:Europe/Paris - The default timezone is UTC — if you haven't set a timezone, summaries post at 09:00 UTC
- Run
/config statusto see the current timezone setting
/link fails with an error
- Double-check your API key — copy it fresh from Store Settings → API
- Make sure
FORGESTORE_URLin.envpoints to your ForgeStore instance with no trailing slash - The API returns 401 if the key is wrong — 404 if the store ID doesn't exist
Bot crashes on startup
- Check
.envis present andDISCORD_TOKENis set correctly - Run
npm installto ensure all dependencies are installed - Node.js v18 or higher is required — check with
node --version - If using PM2, run
pm2 logs forgestore-botto see the full error output
#help channel of our Discord server.