Discord Bot for a Roleshop with currency that can be earned by writing messages.
User earn points by writing messages. With those points, they can purchase special roles from a built-in shop.
The link above will invite a bot hosted by me that uses the latest version of this repo.
Alternatively you can host the bot yourself. Instructions below ⏬
- Earn points by writing messages
- Spend points in a built-in shop
- Customizable shop
- Random gifts
- Can be disabled
- Cooldown can be set
- Chance can be set
- Optional multiplier for server boosters [Default: 2x]
- Can be set on every Discord server individually
- Slash commands
- Admin commands
- User commands
- Translations
- Multi-language support (Can be set on every Discord server individually)
- English (Peer reviewed ✅)
- German (Peer reviewed ✅)
- Easy to set up (Check below)
- Invite bot
- Add roles to the shop (
/rs-add-role
) - Remove roles from the shop (
/rs-remove-role
) - Add role icons to the shop (
/rs-set-role-icon
) - [OPTIONAL] Set server language (
/rs-set-language
) [Default: English] - [OPTIONAL] Set or disable booster multiplier (
/rs-set-multiplier
) [Default: 2x] - [OPTIONAL] Toggle the spam filter (
/rs-spam-filter
) [Default: Enabled] - [OPTIONAL] Toggle and configure random gifts (
/rs-random-gift
) [Default: Enabled, Cooldown: 4hours, Chance: 5%]
- Easy to self-host
- No external database needed
- Easy configuration system
- Install instructions provided below
- Admin-only commands
- Fail-safes to prevent point loss on error
- Automatic Syncing to keep up with DB and Discord states
- Smart Spam Filtering™ via Exponential Smoothing & Moving Average
- Transaction log
- Leaderboard
- Ban / Unban users from using the bot
Feature request or discovered a bug? Please open an Issue here on GitHub.
Setup:
- Invite the bot.
- Add roles to the shop (
/rs-add-role
)- ATTENTION: Make sure the bots role
roleshop
is above the roles you added to the shop! (Server Settings -> Roles -> Drag the bots role above the roles you added to the shop)
- ATTENTION: Make sure the bots role
- Remove roles from the shop (
/rs-remove-role
)
Admin Commands:
- Set a role icon which will be displayed in the shop (
/rs-set-role-icon
) - Set server language (
/rs-set-language
) [Default: English] - Set or disable booster multiplier (
/rs-set-multiplier
) [Default: 2x] - Toggle the spam filter (
/rs-spam-filter
) [Default: Enabled] - Toggle and configure random gifts (
/rs-random-gift
) [Default: Enabled, Cooldown: 4hours, Chance: 5%] - Reset ALL server stats (
/rs-reset-all
) - Set the points of a user (
/rs-set-points
) - View the current transaction log (
/rs-transaction-log
) - List all registered roles (
/rs-list-roles
) - Show admin help (
/rs-admin-help
)
User Commands:
- View the shop (
/rs-shop
) - View your or another users points (
/rs-stats
) - Show the top 10 users with most points (
/rs-top
) - Return a role you bought from the shop (
/rs-return
) - Show user help (
/rs-help
) - Shop bot info (
/rs-info
)
- Open up your favourite terminal (and navigate somewhere you want to download the repository to).
- Make sure you have NodeJS installed (>= v20.0.0). Test by entering
$node -v
If this returns a version number, NodeJS is installed. If not, get NodeJS here. - Clone the repository and navigate to it. If you have Git installed, type
$git clone https://github.com/NullDev/Discord-RoleShop.git && cd Discord-RoleShop
If not, download it here and extract the ZIP file.
Then navigate to the folder. - Install all dependencies by typing
$npm install
- Copy config/config.template.js and paste it as
config/config.custom.js
- Configure it in your favourite editor by editing
config/config.custom.js
. OR usenpm run generate-config
- Start it in development mode by running
$npm start
or start in production mode
$npm run start:prod
Once the config has been copied like described in Step 4, it can be changed to your needs:
{
discord: {
bot_token: "", // Auth Token of the Discord bot. Can be created here: https://discordapp.com/developers/
bot_status: "Usage: /rs-help", // Bot activity ala "Is playing..."
},
bot_settings: {
slash_command_prefix: "rs", // Prefix for all slash commands. e.g. `/rs-foo`, `/rs-bar`.
spam_filter: {
alpha: 0.4, // The smoothing factor for the expavg spam filter (smaller = stricter)
window: 5, // The window for the moving average (last `n` messages) for calculation
},
emote_server_id: "", // Server for uploading role icons to be displayed in shop
},
}
Made with contrib.rocks.