Skip to content

AstroGD/discord-accept-rules-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Accept Rules

Discord Accept Rules is a simple Discord Bot that let's members get a role by clicking on a reaction. While this can be used in many different ways, the most common is to get access to a server after verifying and agreeing to the servers rules.

This is a simple bot with just one use case - No overloaded functionality and not resource-heavy

Installation

  • Edit config/config.json and insert your Discord Bot User Token Here's an explanation on how to create a Discord Bot Account.
  • In order for your bot to work make sure to enable the "Server Members Intent"! More on that can be found here
  • Edit config/discord-accept-rules-bot.json and insert the required values:
    • guildid: The ID of the server, the Bot should listen to (Example: 195221422682013696).
    • roleid: The ID of the role, the Bot should give Users, that accepted the rules.
    • embedColor: The Hex Color with the "#" that should be used for the Embed, the Bot sends where you can accept the rules.
    • verifyMessageTitle: The Title of the Embed
    • verifyMessageDescription: The Description of the Embed
    • verifyMessageFields: Field Values if you need more content inside your embed (Scroll down for more information)
    • verifyMessageReaction: Reactioncode of the Reaction that is being used to verify the rules. To get the Reactioncode, search your emoji here and click on "copy".

Usage

To start the Bot you need NodeJS installed on your Device. Then open a command prompt in the folder, you've installed the Mainframe to and type npm install. This will install all required dependencies that are needed to run the bot. This may take a while depending on the speed of your server's internet connection and performance.

NodeJS 12 or higher is required for this bot to work!

After the installation is finished type npm start in the same location; the Bot should now start. After finishing the initialization you can type help and press enter to get a list of available commands.

Note: you don't need to install the dependencies every time you want to run the bot. This step is only required once before your first use and after you update your bot.

verifyMessageFields

verifyMessageFields contains an Array with an object for each additional field. Each Object can contain the following parameters:

  • title: (String) The Title of your Field
  • value: (String) The content of your Field (supports formatting)
  • inline: (Boolean, Default false) true if you want the field to be on the right side of the field above. You can create Table like Structures with this option
  • empty: (Boolean, Default false) if true an empty Field wil be created for spacing. title and value are being ignored, inline not!

Example:

[
 {
  "title": "Title",
  "value": "Content",
  "inline": true
 },
 {
  "title": "Title2",
  "value": "Content2",
  "inline": true
 },{
  "empty": true
 },{
  "title": "After Empty",
  "value": "After Empty content"
 }
]

Role and Serverids

To get Role and Serverids, you may use a bot, to keep things simple. I recommend DynoBot. You can kick Dyno after you've got the required ID's

Get Serverid: ?serverinfo --> On the bottom of the Embed you can find ID: "SOME ID HERE" Get Role-ID: ?roleinfo --> First field contains the ID of the role

Using custom emojis as reaction

If you want the bot to react with a custom emoji, you need to adjust the discord-accept-rules-bot.json config. The property verifyMessageReaction not only accepts Unicode emojis, but also Discord Emoji Identifiers.

To get an identifier of a custom emoji use /getEmoji [Emoji]. Adjust accordingly if you have changed the prefix for this command
Make sure you haven't disabled this command in the config if you want to use it!

Note: The bot can only use emojis from your server or other servers he was invited in - Custom emojis from servers the bot is not connected to will result in an "unknown emoji" error

Updating from V1

If you have used V1 of this bot: No worries

  • Make sure you have NodeJS 12 or higher installed by using node -v inside a console window
  • Replace every file except files located in "db" or "config" with the new ones from here
  • Run npm install inside the bots folder to install all required dependencies
  • Make sure you have "Server Members Intent" enabled for your Discord Bot Application. More on that can be found here

Now you're good to go!

If you're having issues make sure to reach out to me

Thank you for using my Bot

If you have any questions feel free to reach out:

Twitter: @astrogd

Instagram: @astrogd

Email: hello@astrogd.eu

Discord: AstroGD#3416 Discord Server