Skip to main content

Examples

Full Example Projects

The GitHub repository linked below showcases a set of simple bots created using Discord4J

What do the example projects demonstrate?

  • How to set up Maven or Gradle for a Discord4J bot.
  • Have the bot connect to Discord's gateway.
  • A simple set of commands (ping-pong and greet) to show how to create, delete, and edit slash commands with minimal work.
  • How utilizing the Spring Boot Framework can eliminate large amounts of boilerplate.
  • How to use Logback, an SLF4J logger implementation to log to console.
  • And more.

Minimal Example Classes

A set of example classes showing how to interact with the Discord API using D4J are provided in our GitHub repository.

These classes break down more complicated tasks into minimal code examples in a single java class.