https://github.com/saseq/jda-newtils
New tools and utilities for JDA
https://github.com/saseq/jda-newtils
api bot discord java jda jda-discord-bot jda-utilities
Last synced: 10 months ago
JSON representation
New tools and utilities for JDA
- Host: GitHub
- URL: https://github.com/saseq/jda-newtils
- Owner: SaseQ
- Created: 2025-02-11T14:06:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T21:10:42.000Z (over 1 year ago)
- Last Synced: 2025-08-21T23:48:47.508Z (10 months ago)
- Topics: api, bot, discord, java, jda, jda-discord-bot, jda-utilities
- Language: Java
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 📖 Description
JDA-Newtils is a modern series of tools and utilities for use with [JDA](https://github.com/DV8FromTheWorld/JDA) to assist in bot creation.
## 🔬 Installation
You will need to add this project as a dependency (via Maven or Gradle), as well as [JDA](https://github.com/DV8FromTheWorld/JDA).
The minimum java version supported by JDA-Newtils is Java SE 11.
[](https://jitpack.io/#SaseQ/JDA-Newtils)
### Maven
```xml
jitpack.io
https://jitpack.io
```
```xml
com.github.SaseQ
JDA-Newtils
$version
```
### Gradle
```gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```
```gradle
dependencies {
implementation 'com.github.SaseQ:JDA-Newtils:$version' // replace $version with the latest version
}
```
## 🏃♂️ Getting Started
We provide a number of [examples]() to introduce you to JDA-Newtils. You can also take a look at our official [Wiki](https://github.com/SaseQ/JDA-Newtils/wiki).
Starting your bot and setup default JDA-Newtils configuration:
```java
public static void main(String[] args) {
JDA jda = JDABuilder.createDefault("$token") // replace $token your discord bot token
.build();
CommandManager manager = new CommandManager();
manager.setOwnerId("$owner_id"); // replace $owner_id with your user discord id
manager.setDevGuildId("$dev_guild_id"); // replace $dev_guild_id with your discord server id (remove this line on prod)
manager.addCommand(new Ping());
jda.addEventListener(manager);
}
```
Example of how to create a ping SlashCommand which we registered earlier in the main function:
```java
public class Ping extends SlashCommand {
public Ping() {
this.name = "ping";
this.description = "Performs a ping to see the bot's delay";
}
@Override
public void execute(@NonNull SlashCommandInteractionEvent event) {
event.reply("Ping: ...").queue(m ->
m.editOriginal("Pong! " + event.getJDA().getGatewayPing() + "ms").queue()
);
}
}
```
A more detailed examples with other JDA-Newtils tools can be found in the [Wiki](https://github.com/SaseQ/JDA-Newtils/wiki).