Commandler for Discord using the JDA (Java Discord API) library.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
SethFalco dc114c051b
All checks were successful
ci/woodpecker/manual/ci Pipeline was successful
docs(badges): delete pipeline badge
This is just noise which I used to do because I thought it was cool. And it
kind of still is, but all platforms show the success status in the latest commit
anyway so it's redundant.
2026-09-28 23:08:02 +02:00
.woodpecker chore(forge): migrate .gitlab-ci.yml to .woodpecker 2026-09-03 21:38:48 +01:00
config/checkstyle chore: update checkstyle rules 2025-04-03 15:57:14 +01:00
core chore: format guild.gradle 2025-04-02 17:01:33 +01:00
gradle/wrapper chore: update gradle for java 17 2025-04-01 20:34:49 +01:00
validation chore: format guild.gradle 2025-04-02 17:01:33 +01:00
.editorconfig chore(editorconfig): specify a list of file formats instead of * 2026-09-03 21:38:15 +01:00
.gitignore [skip-ci] Updated Dependencies and Gradle 2020-06-02 07:38:26 +02:00
build.gradle chore: format guild.gradle 2025-04-02 17:01:33 +01:00
gradlew chore: update gradle for java 17 2025-04-01 20:34:49 +01:00
gradlew.bat chore: update gradle for java 17 2025-04-01 20:34:49 +01:00
LICENSE * Updated Gradle Version 2019-12-04 04:41:59 +01:00
NOTICE chore: update copyright notices and attribution 2025-04-01 21:12:02 +01:00
README.md docs(badges): delete pipeline badge 2026-09-28 23:08:02 +02:00
settings.gradle chore: update copyright notices and attribution 2025-04-01 21:12:02 +01:00

Comcord

Deprecation Notice

Comcord has not been worked on for years, and pre-dates Discord Slash Commands. As I'm no longer a Discord user, it's very unlikely I'll set time aside to maintain this project.

I would be happy to provide support and endorse a fork of this project, or a new library altogether that bridges Commandler to Discord if someone else was interested in maintaining it. Feel free to get in contact!

About

Comcord (Commandler for Discord) was an extension to Commandler for integration with Discord.

Heads-up!

Comcord is not itself a wrapper around the Discord API. It's an integration between Commandler, the command handling framework, and JDA, an API client for Discord.

Getting Started

Import

Visit Comcord on Maven Central, and follow the instructions for your build system of choice to add Comcord to your project.

Setup Commandler

It's recommended to start by following the "Your First Command" section of Commandler. Once you've done this and your command is working, you can replace the console module with Comcord.

Scaffolding

Create an application.yml file in your classpath. Here you can configure your application, including Commandler.

main/resources/application.yml

commandler:
  standard-dispatcher:
    prefixes: 
      - "$"
discord:
  bot-token: "{BOT_TOKEN}"
comcord:
  listen-to-bots: false
  listen-to-edit-events: true

Next, create a class that produces the instance of the JDA client. This adds JDA to the CDI container, so it can be injected into any class that needs it, including your controllers.

main/java/org/example/bot/Main.java

public class Main {

    /** Create the Commandler instance and runs all integrations. */
    public static void main(String[] args) {
        Commandler commandler = Commandler.create();
        commandler.run();
    }
    
    @ApplicationScoped
    public static class DiscordBot {
        
        private final JDA jda;
            
        /** Construct your JDA client. */
        @Inject
        public DiscordBot(DiscordConfig discordConfig) throws LoginException {
            String token = discordConfig.getBotToken();
            jda = JDABuilder.create(token, GatewayIntent.GUILD_MESSAGES).build();
        }
    
        /** Add the JDA instance as a singleton to the CDI container. */
        @ApplicationScoped
        @Produces
        public JDA getJda() {
            return jda;
        }
    }
}