-
Install Node.js 22.x
-
Import the bot
git clone https://github.com/pkd2210/Discord-Economy-Bot.git -
Run
npm ci -
Create a
.envfile with:DISCORD_TOKEN=YOUR_BOT_TOKEN CLIENT_ID=YOUR_CLIENT_ID GUILD_ID=YOUR_GUILD_ID
-
Configure
config.jsonfor bot settings (embed color, log channel, daily payout, etc) or use the /config command. -
Start the bot with
node index.js
| Name | Description | Default Setting |
|---|---|---|
default_balance |
The default amount of money a person gets when they enter the server | 0 |
log_channel_id |
Channel ID for logging important actions | (none) |
command_room |
Channel ID where commands can be used | (none) |
balance_per_message |
Amount of money earned per message | 0 |
messages_cooldown_secends |
Cooldown (in seconds) between earning money from messages | 0 |
leaderboard_limit |
Number of users shown in the leaderboard (Max 25!) | 10 |
daily_payout |
Amount given for daily claim | 0 |
embed_color |
Hex color for all embed messages (e.g., #FFFFFF) |
#FFFFFF |
reward_room |
Channel ID where item purchase notifications are sent | (none) |
reward_giver_id |
Role ID to mention when an item is purchased | (none) |
/addbalance— Add balance to a user/removebalance— Remove balance from a user/balance— Check your or another user's balance/daily— Claim a daily payout (configurable)/leaderboard— View the top users by balance/buyitem- Purchase an item from the shop/giveaway- Create a giveaway for points- Earn money by sending messages (with cooldown)
(Planned) Earn money by inviting users
/createitem— Create a new shop item (supports code-based or stock-based items)/edititem— Edit item details (name, description, price, stock)/removeitem— Remove an item and its codes from the shop/addstock— Add a code to an item's stock (for code-based items)/shop— View all items in the shop
/config— Change bot configuration (log channel, embed color, payouts, etc)
- Uses SQLite for persistent storage of users and items
- Each item can have its own codes table for unique code stock
- All important actions (balance changes, item changes, config updates) are logged to a configurable channel
index.js— Main bot logic and event handlingcommands/— All slash command implementationsconfig.json— Bot configurationusers.db— User balances and daily trackingitems.db— Shop items and item codes
I used GitHub Copilot for code completions, wording, some SQLite queries, and bug understanding (not direct bug fixing, but understand the bugs).