https://github.com/sxmurxy0/discord-webhook-api
Java API tool for easy work with discord webhooks.
https://github.com/sxmurxy0/discord-webhook-api
discord discord-api discord-webhook discord-webhook-api webhook
Last synced: about 1 month ago
JSON representation
Java API tool for easy work with discord webhooks.
- Host: GitHub
- URL: https://github.com/sxmurxy0/discord-webhook-api
- Owner: sxmurxy0
- Created: 2023-07-04T14:52:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T02:44:23.000Z (almost 3 years ago)
- Last Synced: 2025-06-12T20:32:25.627Z (about 1 year ago)
- Topics: discord, discord-api, discord-webhook, discord-webhook-api, webhook
- Language: Java
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Discord-Webhook-API:stars:
Java API tool for easy work with discord webhooks. Send files, embeds or just text messages.
More information and examples are [**here**](https://birdie0.github.io/discord-webhooks-guide/index.html). You can also use discord text formatting in your messages.
## Example message

## Example's code
It doesn't matter in what order you will add components. Discord manages it itself.
```java
private final WebhookAgent webhook = new WebhookAgent("your.webhook.url");
public void test() {
DiscordMessage message = DiscordMessage.builder()
.withUsername("CUSTOM USERNAME")
.withAvatar("https://foni.club/uploads/posts/2023-01/1673429102_foni-club-p-super-puper-mega-krutie-oboi-48.jpg")
.withContent("Your message. **You can** `write anything you` __want__")
.addEmbed(DiscordEmbed.builder()
.withTitle("Testing testing title!")
.withDescription("Description time")
.withColor(Color.WHITE)
.withAuthor(new AuthorEmbed("sxmurxy", "https://sun6-21.userapi.com/s/v1/if1/dBGCgSOmmhlMRrHKvpRg7-tBe2C61B-SF37DfOxFIlJWolDCE9o0KIsegJXqzaaCX1if5y4k.jpg?size=639x639&quality=96&crop=0,76,639,639&ava=1", "https://vk.com/traplicate"))
.withImage(new ImageEmbed("https://yt3.googleusercontent.com/wxbc8Sby-cCy3zjWtFeLr3iO-j8hg_PfaSCiGJ-WioNTxv29EzNF6l07Ce0M4jsxoCE9EC_VXg=s900-c-k-c0x00ffffff-no-rj"))
.withThumbnail(new ThumbnailEmbed("https://sun6-21.userapi.com/s/v1/if1/dBGCgSOmmhlMRrHKvpRg7-tBe2C61B-SF37DfOxFIlJWolDCE9o0KIsegJXqzaaCX1if5y4k.jpg?size=639x639&quality=96&crop=0,76,639,639&ava=1"))
.withTimestamp(System.currentTimeMillis())
.addFields(new FieldEmbed("Field1", "Value1", true),
new FieldEmbed("Field2", "Value2", true),
new FieldEmbed("Field3", "Value3", true),
new FieldEmbed("Field4", "Value4", true))
.withFooter(new FooterEmbed("Footer text right there!", "https://sun6-21.userapi.com/s/v1/if1/dBGCgSOmmhlMRrHKvpRg7-tBe2C61B-SF37DfOxFIlJWolDCE9o0KIsegJXqzaaCX1if5y4k.jpg?size=639x639&quality=96&crop=0,76,639,639&ava=1"))
.build())
.addFile(new File("C:/Users/%USERNAME%/Downloads/file"))
.build();
webhook.execute(message);
}
```
## Dependencies
```gradle
dependencies {
implementation 'com.google.code.gson:gson:2.10'
implementation 'org.apache.httpcomponents:httpmime:4.5.14'
}
```