Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

A Discord bot that allows users to self-assign roles using reactions.

License

Notifications You must be signed in to change notification settings

peterthehan/discord-reaction-role-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Reaction Role Bot

Discord Twitter Follow

A Discord bot that allows users to self-assign roles using reactions.

demo

Setup

  1. Follow the instructions in create-discord-bot.

    Don't forget to give your bot the Manage Roles and Manage Messages permissions (only grant the latter if the bot should handle reactions)!

  2. Download this bot and move the src-discord-reaction-role-bot folder into the /src/bots folder from step 1.

  3. Open config.json to configure your own settings:

    [
      {
        "messageId": "858190737065902101",
        "channelId": "258314939998011393",
        "removeReaction": true,
        "policy": "any",
        "emojiRoleMap": {
          "🤖": ["858186589187735565"],
          "🎉": ["542138999511187486"],
          "🥤": ["785794153089990688"]
        }
      }
    ]

    Add as many rules as you want to configure for other servers.

    • messageId is the message you want the bot to react to for your reaction roles.

    • channelId is the text channel the message is in.

    • removeReaction determines whether the user reaction is removed (true) or not (false).

    • policy must be one of the following strings:

      • once: User is only allowed to react and claim roles once. Subsequent reactions are ignored.
      • any: User can react and claim as many roles as they want.
      • unique (default): User can react and claim only one emoji's set of roles at a time.
    • emojiRoleMap is a one-to-many key-value map between emoji and role ids. An emoji can be:

      • A unicode emoji. https://emojipedia.org is a good reference to copy and paste from.

          "emojiRoleMap": {
            "😳": ["ROLE_1_ID"],
            "🥺": ["ROLE_2_ID", "ROLE_3_ID", "ROLE_4_ID"]
          }
      • An emoji ID for custom emojis. You can get a custom emoji's ID by sending \:YourCustomEmoji: in chat (prefix a backslash \ character in front of your desired emoji).

        "emojiRoleMap": {
          "716344914706694165": ["ROLE_1_ID"],
          "622635442013208589": ["ROLE_2_ID", "ROLE_3_ID", "ROLE_4_ID"]
        }
  4. npm start to run the bot.

Visit for more help or information!