Discord

API for Discord Webhook messages.

License

License

Categories

Categories

Discord API Business Logic Libraries
GroupId

GroupId

com.github.rillis
ArtifactId

ArtifactId

discord
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Discord
API for Discord Webhook messages.
Project URL

Project URL

https://github.com/rillis/discord/
Source Code Management

Source Code Management

http://github.com/rillis/discord/tree/master

Download discord

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.json : json jar 20190722

Project Modules

There are no modules declared in this project.

Discord

Maven License

<dependency>
  <groupId>com.github.rillis</groupId>
  <artifactId>discord</artifactId>
  <version>1.0.1</version>
</dependency>

Docs

Example:

String webhookUrl = "";
Discord discord = new Discord(webhookUrl,"RillisBOT", "https://via.placeholder.com/400x400.png");

//(1) only content:
String content = "FooContent";
try {
	discord.sendMessage(content);
} catch (IOException e) {
	e.printStackTrace();
}

//(2) content and/or embed(s):

//Setup content, in this case this can be null (only if embed != null)
content = "FooContent";

//Setup for embed

//Author stay on top of the message
//Author or any arguments can be null or blank
Author author = new Author("Rillis Vernucio","https://github.com/rillis/discord","https://avatars2.githubusercontent.com/u/16558619?s=460&u=a83e4a1703074c46f28baab5a67c37c687c2fcfd&v=4");

//Those can be blank or null
String title = "Title placeholder";
String url = "https://github.com/rillis/discord";
String description = "Description placeholder.";

//Color can be 0 if you don't want as a part of the message.
long color = 392183;

//Fields (isn't required), if you aren't using it just set:
//Field[] fields = null;
Field field1 = new Field("Foo1","Bar1",true);
Field field2 = new Field("Foo2","Bar2",true);
Field field3 = new Field("Foo3","Bar3",false);
Field[] fields = {field1, field2, field3};

//Any of those can be null
Thumbnail thumbnail = new Thumbnail("https://via.placeholder.com/200x400.png");
Image image = new Image("https://via.placeholder.com/350x350.png");
Footer footer = new Footer("Footer text", "https://via.placeholder.com/400x400.png");

//Setup embed using variables above
Embed embed = new Embed(author, title, url, description, color, fields, thumbnail, image, footer);

//embed field can be an array for multiple embeds
try {
	discord.sendMessage(content,embed);
} catch (IOException e) {
	e.printStackTrace();
}

Versions

Version
1.0.1
1.0.0