Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

xAsbeel/JDACommands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JDACommands

Simple command library for JDA.
For now it only supports slash commands, support for context menus is planned.

Dependency

In order to use this library you must also include JDA in your build.

Maven (pom.xml)

  <repositories>
    <repository>
      <id>minecodes-repo</id>
      <url>https://repository.minecodes.pl/releases</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>ovh.nikox.jdacommands</groupId>
      <artifactId>JDACommands</artifactId>
      <version>1.0.0</version>
    </dependency>

    <!-- JDA is required. -->
    <dependency>
      <groupId>net.dv8tion</groupId>
      <artifactId>JDA</artifactId>
      <version>YOUR-JDA-VERSION</version>
    </dependency>
  </dependencies>

Gradle (build.gradle)

repositories {
  mavenCentral()
  maven("https://repository.minecodes.pl/releases")
}

dependencies {
  implementation("ovh.nikox.jdacommands:JDACommands:1.0.0")
  implementation("net.dv8tion:JDA:VERSION")
}

Usage

  1. SlashCommands

Initializer class

CommandMap map = CommandMap.slash(jdaInstance);

map.registerCommand(slashCommand);
map.updateGlobal();

Command class

public class MyCommand implements SlashCommand {
  
  @Override
  public void call(@NotNull SlashCommandInteractionEvent event) {
    event.reply("It works!").queue();
  }
  
  @Override
  public SlashCommandData getCommandData() {
    return Commands.slash("hello", "Hello World!");
  }

About

Simple command library for JDA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages