https://github.com/4drian3d/jdwebhooks
A Java library to send Discord WebHooks easily
https://github.com/4drian3d/jdwebhooks
discord java java-17
Last synced: 11 months ago
JSON representation
A Java library to send Discord WebHooks easily
- Host: GitHub
- URL: https://github.com/4drian3d/jdwebhooks
- Owner: 4drian3d
- License: apache-2.0
- Created: 2023-05-25T17:06:16.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-24T03:31:20.000Z (11 months ago)
- Last Synced: 2025-04-24T04:27:13.647Z (11 months ago)
- Topics: discord, java, java-17
- Language: Java
- Homepage:
- Size: 303 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JDWebHooks
A library to send Discord WebHooks easily
## Requirements
- Java 17
## Usage
### Dependency
```kotlin
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.4drian3d:jdwebhooks:1.0.1")
}
```
### Example
```java
import java.net.http.HttpResponse;
import java.util.concurrent.CompletableFuture;
public class Main {
public static void main(String[] args) {
final WebHookClient client = WebHookClient.from("id", "token");
final Embed embed = Embed.builder()
.author(Embed.Author.builder().name("4drian3d").build())
.timestamp(Instant.now())
.color(0xFF0000)
.title("My first Discord WebHook")
.build();
final WebHook webHook = WebHook.builder()
.username("4drian3d was here")
.embed(embed)
.build();
final CompletableFuture> futureResponse = client.sendWebHook(webHook);
}
}
```
