Contributing - Seosaidh/torRpgBot GitHub Wiki
Contribution Guidelines
The following guidelines should be followed by all who desire to contribute to this project:
- Do not modify code beyond the task you are currently working on.
- Perform all modifications on a branch.
- A branch should have a descriptive name of the modification/addition being made.
- No profanity should be introduced into the bot.
- Write JavaDoc comments for all classes and at least all public functions.
Environment Setup
The steps below will detail how to set up the development environment in Eclipse. They assume that git is already installed on the development environment.
- Clone the repository
- Download the following libraries
- JDA 3.7.1 or greater
- Log4j2 2.11.1 or greater
- GSON 2.8.5 or greater
- TestNG (Although you can just install the Eclipse plugin if desired)
- Untar the libraries in some location
- Open Eclipse
- Create a new Java Project
- Uncheck the "Use Default Location"
- Browse to the torRpgBot directory just cloned from GitHub
- Make sure that the Java version is set to 8
- Click Next
- Under Libraries Add the following jar files from the downloaded libraries as external Jars:
- JDA-X.Y.Z_ABC-withDependencies.jar
- log4j-slf4j-impl-X.Y.Z.jar
- log4j-core-X.Y.Z.jar
- log4j-api-X.Y.Z.jar
- gson-X.Y.Z.jar
- As you add each external library, click on the dropdown in the window, then select the sources and javadoc and map to the relevant jar files in the downloaded libraries
- Click on Finish and you're ready to go!
Basics
In order to add a new command, you simply need to create a new class that extends the Command class. Make sure that getAliases doesn't return any strings that are already in use by other commands. Please keep in mind that the matching is case-insensitive, but otherwise is exact string matching, so while "h" and "help" are in use for the help command, "he" is not.
Testing
It is recommended that you test your class(es) as much as possible. To that end, this project uses TestNG for unit testing. Please see various on-line tutorials and documentation for information on how to create and run tests.
Guidelines
Make sure that you work on a branch, not directly on master. Please name your branch relevant to the issue you are working on. This project does not use strict GitFlow, but descriptive branch names are still preferable. Please also make sure that you are working on an issue in the issue tracker, and that it is assigned to you, otherwise someone else might come along and also work on the same issue.
Nothing should be merged into master without a proper pull request.