Skip to content

NullDev/Discord-RoleShop

Repository files navigation

Discord-RoleShop

cd License GitHub closed issues

Discord Bot for a Roleshop with currency that can be earned by writing messages.


❓ What does it do?

User earn points by writing messages. With those points, they can purchase special roles from a built-in shop.


📡 Invite the bot

Invite

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 ⏬


⭐ Features

  • 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 requests & Issues

Feature request or discovered a bug? Please open an Issue here on GitHub.


🔧 Discord Bot Setup for server admins

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)
  • 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)

🔧 Dev Setup

  1. Open up your favourite terminal (and navigate somewhere you want to download the repository to).

  2. 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.

  3. 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.

  4. Install all dependencies by typing
    $ npm install

  5. Copy config/config.template.js and paste it as config/config.custom.js

  6. Configure it in your favourite editor by editing config/config.custom.js. OR use npm run generate-config

  7. Start it in development mode by running
    $ npm start
    or start in production mode
    $ npm run start:prod


🔩 Configuration

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
    },
}

:octocat: Contributors

Made with contrib.rocks.


About

Discord Bot for a Roleshop with currency that can be earned by writing messages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published