-
Install Node.js 22.x
-
Import the bot
git clone https://github.com/pkd2210/Slack-economy-Bot.git -
Run
npm ci -
Create a
.envfile with:SLACK_SIGING_SECRET=
RE> SLACK_BOT_TOKEN=RE> APP_TOKEN=RE> -
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- Earn money by sending messages (with cooldown)
/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
- 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 // discord only
index.js— Main bot logic and event handlingscommands/— 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).