Skip to content

Commit

Permalink
Updated the README.md to reflect the new Methods and added a Note at …
Browse files Browse the repository at this point in the history
…the Configuration Section
  • Loading branch information
JoshiCodes committed Feb 14, 2024
1 parent f5353e7 commit c50f684
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ ModuleLoader.loadModules(JDABuilder, Module, @Nullable Module...)
### Configuration
One of the most important Features, are the Configurations. These do not require a Module and could be used Stand-alone.
There are a few different sort of Configurations, which are all listed below:
<br>
**Note:** There are far better implementations for Configuration Files. This implementation is old and only used for simple Configurations.
Personally, I would recommend using [boosted-yaml](https://github.com/dejvokep/boosted-yaml).
```
- JsonConfig
- YamlConfig
Expand Down Expand Up @@ -97,9 +100,11 @@ ModuleLoader.loadModules(builder, new ReactionMessageModule());
You then can create a new ReactionMessage with the ReactionMessage.Builder.
With this Builder you can define the message and add the Role Buttons.
To change the message use `ReactionMessage.Builder#setEmbed`.
You then can add new Roles using `ReactionMessage.Builder#addButton(String label, String roleId)`
You then can add new Roles using `ReactionMessage.Builder#addOption(String label, String roleId)`
If you want, you can change the Type from MULTIPLE to SINGE, wich allows the user to only have one Role per message.
You can do that using `ReactionMessage.Builder#setType(ReactionMessage.Type)`.
There is also the option to use a SelectMenu instead of Buttons. To do that, just set the Type to `ReactionMessage.Type.SELECT`.


For example:
````
Expand All @@ -116,8 +121,8 @@ builder.setEmbed(embedBuilder); // You could also use #setMessage(MessageEmbed)
builder.setType(ReactionMessage.Type.SINGLE); // Default is MULTIPLE, so no need to change it if you want to use MULTIPLE
// Add buttons
builder.addButton("Role 1", "1234567890");
builder.addButton("Role 2", "0987654321");
builder.addOption("Role 1", "1234567890");
builder.addOption("Role 2", "0987654321");
````

You then can build the ReactionMessage with `ReactionMessage.Builder#build()`. This will return a new ReactionMessage Element.
Expand Down

0 comments on commit c50f684

Please sign in to comment.