A small Discord bot command utility for JDA bots. PCF provides registries and event routing for slash commands, context commands, buttons, modals, string selects, and entity selects.
- Java 21+
- JDA 6
- Maven / Gradle
This library is available on maven central. The latest version is always shown in the GitHub Release.
<dependency>
<groupId>dev.eposs</groupId>
<artifactId>PCF</artifactId>
<version>$version</version> <!-- replace $version with the latest version -->
</dependency>repositories {
mavenCentral()
}
dependencies {
implementation("dev.eposs:PCF:$version") // replace $version with the latest version
}Commands are published when JDA becomes ready. Guild commands are updated when guilds become ready or when the bot joins a guild.
public static void main(String[] args) {
new PCF("YOUR_DISCORD_USER_ID"); // Optional: Add a set trusted users (Set.of())
CommandRegistry.register(CommandRegistry.Type.GLOBAL, new MySlashCommand());
ButtonRegistry.register(new MyButtonHandler());
JDABuilder.createDefault(token)
.addEventListeners(new PCFEventListener(pcf)) // Optional: Add custom implementation of IExceptionHandler
.build();
}