Goldmine

3 minute read Published:

Goldmine is a multifunction Discord bot that offers music playback, conversation, cats, and more.

Built in Java, Goldmine is serving users in nearly 4,000 groups.

Usage

You can add the bot to your Discord server by clicking here. 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.

If you prefer selfhosting, refer to the instructions on the GitHub page.

Features

  • Rich help
  • Smooth music from YouTube, Bandcamp, Vimeo, and SoundCloud.
  • Reliable
  • Pokemon
  • Over 60 commands
  • Reaction polls
  • Text styles
  • Conversations
  • DM conversations
  • Customizable command prefixes
  • Automatic, seamless error reporting
  • Responds fast
  • Proper reasons in audit log
  • Quotes
  • Reminders
  • Moderation
  • Customizable user profiles

… and too many more to list!

Implementation

The bot is flexible due to dynamically loadable modules called “cogs” that are each a single class. Reflection is used to discover all the modules upon start, and additional reflection is used to instantiate them. Commands are just methods on the class with a special annotation.

Permissions are perhaps the messiest component, but it works well and keeps the module code clean. Special annotations are used for every permission, with some special combinations of OR permissions. These annotations have a single field, with a default value that holds the permission information. Reflection is used to obtain the value field on every permission annotation and fill the command’s information accordingly.

Error Handling

Errors are logged in full detail, as well as reported to Sentry. Sentry is very useful for categorizing errors and keeping track of all of them as they are fixed.

Conversation

Goldmine is integrated with ChatEngine to provide natural language conversation capabilities. Here is an example conversation:

User: Hi

Bot: Heya!

User: How are you doing?

Bot: I am doing well, how about you?

User: Fine, thank you.

Bot: What have you been doing today?

User: Nothing much, just talking to you.

Bot: You are talking to yourself.

User: No, I’m not.

Bot: I love you more than every piece of grain in the world.

User: That’s very nice of you!

Bot: I’m just that good.

Source

The full source code of the current revision of Goldmine (Bluestone) can be found on GitHub.