DiscordWebhook-Ktl

DiscordWebhook-Ktl is a wrapper around the discord webhook bot REST api.

License

License

Categories

Categories

Discord API Business Logic Libraries
GroupId

GroupId

com.github.shynixn
ArtifactId

ArtifactId

discordwebhook-ktl
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

jar
Description

Description

DiscordWebhook-Ktl
DiscordWebhook-Ktl is a wrapper around the discord webhook bot REST api.
Project URL

Project URL

https://github.com/Shynixn/DiscordWebhook-Ktl

Download discordwebhook-ktl

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.shynixn/discordwebhook-ktl/ -->
<dependency>
    <groupId>com.github.shynixn</groupId>
    <artifactId>discordwebhook-ktl</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.shynixn/discordwebhook-ktl/
implementation 'com.github.shynixn:discordwebhook-ktl:1.2'
// https://jarcasting.com/artifacts/com.github.shynixn/discordwebhook-ktl/
implementation ("com.github.shynixn:discordwebhook-ktl:1.2")
'com.github.shynixn:discordwebhook-ktl:jar:1.2'
<dependency org="com.github.shynixn" name="discordwebhook-ktl" rev="1.2">
  <artifact name="discordwebhook-ktl" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.shynixn', module='discordwebhook-ktl', version='1.2')
)
libraryDependencies += "com.github.shynixn" % "discordwebhook-ktl" % "1.2"
[com.github.shynixn/discordwebhook-ktl "1.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.20
org.apache.cxf : cxf-rt-rs-client jar 3.3.0
com.fasterxml.jackson.core : jackson-databind jar 2.9.8

test (3)

Group / Artifact Type Version
org.mockito : mockito-core jar 2.23.0
org.junit.jupiter : junit-jupiter-api jar 5.3.1
org.junit.jupiter : junit-jupiter-engine jar 5.3.1

Project Modules

There are no modules declared in this project.

DiscordWebhook-Ktl Build Status GitHub license

branch status coverage version download
master Build Status Coverage GitHub license Download latest release

Description

DiscordWebhook-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.

<dependency>
  <groupId>com.github.shynixn</groupId>
  <artifactId>discordwebhook-ktl</artifactId>
  <version>1.2</version>
</dependency>

2: Include the following additional dependencies.

<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib-jdk8</artifactId>
    <version>1.3.21</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-rs-client</artifactId>
    <version>3.3.0</version>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.9.8</version>
</dependency>

3: Use a Java sample:

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:

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.

Versions

Version
1.2
1.1
1.0