/bluestone

An elaborate Discord bot written in Java. Publicly identifies as Goldmine#1629.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Project Bluestone (Goldmine)

Goldmine Support Discord Bots Vote

This is Project Bluestone, the rewrite of Goldmine in Java.

Discord Bots

How do I use the bot?

Click here to get to the invite page. Next, select the server you want to add the bot to from the dropdown menu shown, and click Authorize. The bot will not be able to read any of your personal information.

Should you want to change the prefix away from the default of !, simply type !prefix [desired prefix] For example, to change the prefix to g$, you would type !prefix g$.

If you forget the prefix or set it to something impossible to type, simply type @Goldmine#1629 prefix to retrieve the current prefix so it is possible to reset the prefix.

For more information, read this page.

Which set of instructions should I follow?

You should follow the instructions above unless you know exactly what you're doing and want to set the bot up locally, on your own computer. If you choose to do so, please note that you will need to keep your computer on constantly or the bot will stop working.

TL;DR Follow the instructions above

Local Installation and Setup

If you want to host the bot on your own computer, and are willing to go through the trouble to do so, read here.

I won't go into huge detail here, refer to other guides online such as JDA's for that.

Make sure Java JDK 8 or newer is installed before proceeding! You can download Java here. Select the JDK instead of JRE or Server JRE.

Have patience, the first build may take a while.

Windows

Run the following commands in a new instance of cmd.exe (Start -> cmd). Administrator is not required.

cd [DRAG bluestone FOLDER INTO WINDOW]
gradlew shadowJar

Success! If everything went right and BUILD SUCCESSFUL is displayed, you're good to go. Proceed to Configuration to complete the setup.

If there are errors, open an issue on GitHub or join the Discord support server.

macOS

Run the following commands in a new instance of Terminal (Applications -> Utilities -> Terminal).

cd [DRAG bluestone FOLDER INTO WINDOW]
./gradlew shadowJar

Success! If everything went right and BUILD SUCCESSFUL is displayed, you're good to go. Proceed to Configuration to complete the setup.

If there are errors, open an issue on GitHub or join the Discord support server.

Linux

Run the following commands in a new terminal window of your choice.

cd [path to bluestone folder]
./gradlew shadowJar

Success! If everything went right and BUILD SUCCESSFUL is displayed, you're good to go. Proceed to Configuration to complete the setup.

If there are errors, open an issue on GitHub or join the Discord support server.

Configuration

You will need to create config.json for the bot to be able to start.

Simple

Create a config.json file with the following contents:

{
  "token": "[token here]"
}

Replace [token here] with your bot token. You can obtain a token by going to the Discord developers page and creating a new app. Fill in the details.

After that, simply click "Create a Bot User" as shown here: Create a Bot User Confirm the action by clicking "Yes, do it!" in the popup.

Now click click to reveal which is after Token:, as shown: Click to Reveal Token

DO NOT SHOW THE TOKEN TO ANYONE! Keep this secret just like it's your Discord account's password.

Copy the token as shown, and paste it into the config.json file described above. Copy Token

Advanced

This is the template:

{
  "token": "token",
  "shard_count": 2,
  "db_url": "h2:./database",
  "db_user": "username",
  "db_pass": "password",
  "graphite_host": "localhost",
  "graphite_port": 2003,
  "keys": {
    "google": "",
    "bots_on_discord": "",
    "discord_bot_list": "",
    "imgflip": {
      "username": "root",
      "password": "toor"
    },
    "sentry": "https://public:private@host:port/1?environment=development&servername=laptop1",
    "ipstack": ""
  },
  "chatengine_url": "http://my-chatengine-server.com/ask"
}

If you aren't filling in a value, delete the line! Empty values will cause errors.

Put your token in for the token key. Then, choose the number of shards you want to use. This is typically unnecessary, and serves no benefit, unless you have 2,500 guilds or more the bot is serving in.

The db_url key is for the database connection. If you don't want to use a server, h2 is probably the best choice. The format for h2 is h2:./[database file name without extension]. The file is saved as name.mv.db, in the current working directory. However, h2 can have a server. If you do want to use a server, such as MySQL, you'll have to write your own URL. It's just passed to JDBC, so any JDBC connection source without jdbc: will work.

Optionally, obtain a Google API key with the following features enabled:

  • Google Custom Search API
  • YouTube Data API v3

and put it in the JSON.

You may also provide Discord Bots and Carbonitex keys if you have valid ones. However, invalid or empty keys will cause errors whenever guild count is updated.

For more reliable memes, you should also provide Imgflip account credentials.

For error reporting, provide a Sentry DSN, optionally with environment and servername set.

For the ipinfo command to work, provide an IPStack access key.

At the very least, you must have an empty keys object. If there is no keys object, or it is another data type, everything may explode.

Finished? Proceed to Running to start the bot.

Running

You can start the bot in two ways:

  • Double-clicking the jar file found in [bluestone folder]/build/libs/bluestone-1.0-SNAPSHOT-all.jar
  • Opening a terminal, navigating to the bluestone folder, and typing java -jar build/libs/bluestone-1.0-SNAPSHOT-all.jar

Feel free to automate the process however you want.

Support

Is something not working? Open a GitHub issue describing your problem, or ask in our Discord support server.

Credits

  • The Strftime class from Apache Tomcat is included under the Apache 2.0 License.