Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4drian3d/jdwebhooks
A Java library to send Discord WebHooks easily
https://github.com/4drian3d/jdwebhooks
discord java java-17
Last synced: 3 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-23T17:45:39.000Z (3 months ago)
- Last Synced: 2024-10-24T01:53:48.490Z (3 months ago)
- Topics: discord, java, java-17
- Language: Java
- Homepage:
- Size: 255 KB
- Stars: 12
- 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);
}
}```
![](https://github.com/4drian3d/JDWebHooks/assets/68704415/e0950431-24c6-42b7-9f3b-302a7e7be8ef)