🤖

ForgeStore Owner Bot

26 slash commands to manage your store, track revenue, and automate Discord roles — all without leaving Discord.

✅ Free to use 🟢 Node.js v18+ 26 commands ⭐ Auto Discord Roles 🏆 Milestone Alerts

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.

🔔
Real-time Sale Alerts
Every purchase triggers an embed in your alert channel — player, package, amount, and payment method. Color-coded by amount.
🎭
Auto Discord Roles
Players who buy VIP automatically get @VIP in Discord. Zero manual work. Configure once with /roles add.
📊
Stats & Revenue
Revenue charts, leaderboards, top packages, wallet balance — all from slash commands without opening a browser.
📅
Daily & Weekly Summaries
Automatic posts at 09:00 every day and every Monday morning, comparing performance to the previous period.
🏆
Milestone Celebrations
Auto-posts when you hit 1st, 10th, 100th, 500th order — and revenue milestones: €100, €500, €1,000, €5,000.
🏪
Store Management
Create coupons, toggle maintenance, enable/disable packages, search orders — all from Discord.

Installation

Step 1 — Create the Discord Application

  1. Go to discord.com/developers/applications
  2. Click New Application → name it ForgeStore
  3. Under General Information, copy the Application ID — you'll need it later
  4. Go to Bot → click Add Bot
  5. Click Reset Token and copy it immediately — it's only shown once
  6. 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

  1. Go to OAuth2 → URL Generator
  2. Under Scopes: check bot and applications.commands
  3. Under Bot Permissions, check these:
    PermissionWhy it's needed
    Send MessagesPost sale alerts and summaries
    Embed LinksShow rich embed cards
    Read Message HistoryAvoid duplicate messages
    Manage RolesAssign Discord roles after purchases
    View ChannelsAccess the alert channel
  4. Copy the generated URL → open it → select your server → Authorize
⚠️
Role hierarchy: For auto-roles to work, the bot's role must be above the roles it assigns in Server Settings → Roles. Drag the bot's role up if needed.

Step 3 — Configure the .env file

owner-bot/.env
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

Terminal
npm install
node src/deploy-commands.js   # register slash commands (run once)
npm start

If successful you'll see:

Expected output
🚀 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)

PM2 — recommended process manager
npm install -g pm2
pm2 start src/index.js --name forgestore-bot
pm2 save        # save process list
pm2 startup     # auto-start on server reboot

Before using any other command, link your ForgeStore store to the Discord server.

Get your API key

  1. Log in to your ForgeStore dashboard
  2. Go to Store Settings → API
  3. Copy your API Key and Store ID

Link the store

Discord
/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:

Discord
/config timezone tz:Europe/Paris
/config timezone tz:America/New_York
/config timezone tz:Asia/Tokyo

Set the alert channel

Discord
/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

CommandDescriptionPermission
/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

CommandDescription
/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

CommandDescription
/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

CommandDescriptionPermission
/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

CommandDescriptionPermission
/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

CommandDescriptionPermission
/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

CommandDescriptionPermission
/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

CommandDescriptionPermission
/ban player username [reason]Ban a player from making purchases on your store.Manage Server
/ban unban usernameRemove a player's ban — they can purchase again.Manage Server

🔔 Alert Preferences

CommandDescription
/alert config sales daily weekly goals stock milestonesToggle each alert type individually with true/false.
/alert statusShow 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

1
Owner sets up mappings
Run /roles add to link packages to roles. For example: packages containing "VIP" → @VIP role, "MVP" → @MVP role.
2
Player verifies once
Each player runs /verify with their game username once. The bot links their Discord ID to their username.
3
Player buys on the store
Player purchases VIP Rank on your ForgeStore store, entering their Minecraft username at checkout.
4
Bot detects the purchase
Within 30 seconds, the polling loop finds the new order.
5
Role assigned automatically
Bot gives @VIP to the player in Discord and posts a confirmation in the alert channel.

Setup (Minecraft example with 4 ranks)

Discord — run by server admin
# 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
Discord — run by each player (once)
/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.

💡
Keyword matching: /roles add "VIP" matches any package whose name contains "VIP" — so it works for "VIP", "VIP Rank", "Monthly VIP", "VIP+", etc. Case-insensitive.
⚠️
Role hierarchy: The bot's role must be above the roles it assigns in Server Settings → Roles. If you see "Missing Permissions" errors, drag the ForgeStore role higher in the list.

Confirmation message

When a role is successfully assigned, the bot posts in the alert channel:

🎭 @Notch received the VIP role — thanks for your purchase!

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:

🔵
< €5
Small sale
🟣
€5–€19
Normal
🟢
€20–€49
Good sale
🟡
€50+
💎 Big Sale!

Automatic scheduled posts

PostWhenContent
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

OrdersMessage 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

RevenueMessage
€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:

Welcome PlayerName! This is their very first purchase on the store!

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.

Discord
/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.

Discord
# 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.

Discord — disable weekly and stock alerts
/alert config sales:true daily:true weekly:false goals:true stock:false milestones:true
AlertDefaultWhat 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

No sale alerts are posting

Auto-roles aren't being assigned

Daily/weekly summaries are posting at the wrong time

/link fails with an error

Bot crashes on startup

Still stuck?
Open a support ticket at forgestore.net/contact or ask in the #help channel of our Discord server.