https://github.com/shynixn/discordwebhook-ktl
DiscordWebhook-Ktl is a wrapper around the discord webhook bot REST api.
https://github.com/shynixn/discordwebhook-ktl
Last synced: 5 months ago
JSON representation
DiscordWebhook-Ktl is a wrapper around the discord webhook bot REST api.
- Host: GitHub
- URL: https://github.com/shynixn/discordwebhook-ktl
- Owner: Shynixn
- License: mit
- Created: 2019-02-07T17:41:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-20T14:29:28.000Z (over 6 years ago)
- Last Synced: 2025-01-01T13:43:50.188Z (6 months ago)
- Language: Kotlin
- Size: 1.78 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DiscordWebhook-Ktl [](https://maven-badges.herokuapp.com/maven-central/com.github.shynixn/discordwebhook-ktl) [](https://raw.githubusercontent.com/DiscordWebhook-Ktl/master/LICENSE)
| branch | status | coverage | version | download |
| ------------- | ------------- | -------- | --------| ---------|
| master | [](https://travis-ci.org/Shynixn/DiscordWebhook-Ktl) | [](https://codecov.io/gh/Shynixn/DiscordWebhook-Ktl/branch/master)| |[Download latest release](https://github.com/Shynixn/DiscordWebhook-Ktl/releases)|
## DescriptionDiscordWebhook-Ktl is a wrapper around the discord webhook bot REST api.
## Features
* A robustful library for REST client calls to discord webhook bots.
## How to use it
1: Include it from the central maven repository.
```xml
com.github.shynixn
discordwebhook-ktl
1.2```
2: Include the following additional dependencies.
```xml
org.jetbrains.kotlin
kotlin-stdlib-jdk8
1.3.21org.apache.cxf
cxf-rt-rs-client
3.3.0com.fasterxml.jackson.core
jackson-databind
2.9.8```
3: Use a Java sample:
```java
String webHookUrl = "yourDiscordWebHookUrlWhichYouCanDirectlyCopyPasteIntoThis";DiscordWebhookService service = new DiscordWebhookServiceImpl();
DiscordPayload payload = new DiscordPayload();
DiscordEmbed embeddedMessage = new DiscordEmbed("Hello World.", ExtensionKt.getDecimal(Color.RED)
,new DiscordAuthor("Shynixn", null, null), "This should represent a simple sample."
,ExtensionKt.getTimestampIso8601(new Date()), new ArrayList<>());
payload.getEmbeds().add(embeddedMessage);service.sendDiscordPayload(webHookUrl, payload);
```3: Use a Kotlin sample:
```kotlin
val webHookUrl = "yourDiscordWebHookUrlWhichYouCanDirectlyCopyPasteIntoThis";val service = DiscordWebhookServiceImpl()
val payload = DiscordPayload()
val embeddedMessage = DiscordEmbed(
"Hello World.",
Color.RED.decimal,
DiscordAuthor("Shynixn"),
"This should represent a simple sample.",
Date().timestampIso8601
)
payload.embeds.add(embeddedMessage)service.sendDiscordPayload(webHookUrl, payload)
```## Licence
Copyright 2019 Shynixn
The source code is licensed under the MIT license.