How to add the library to your project. Its available for both maven and gradle
repositories {
maven { url "https://repo.ceymikey.dev/releases" }
}
dependencies {
implementation "dev.ceymikey:injectionlib:{VERSION}"
}<repositories>
<repository>
<id>ceymikey-releases</id>
<url>https://repo.ceymikey.dev/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dev.ceymikey</groupId>
<artifactId>injectionlib</artifactId>
<version>{VERSION}</version>
</dependency>
</dependencies>
Basic usage of the library in your projects code. The library provides you an option to build
an embed using the EmbedBuilder class and choose when to send it using the inject method call.
package com.example.test;
import dev.ceymikey.injection.EmbedBuilder;
import dev.ceymikey.injection.DiscordPayload;
public class TestClass {
public void testMethod() {
/* Use the EmbedBuilder class to build a new embed */
/* with the correct properties */
EmbedBuilder builder = new EmbedBuilder.Construct()
.setUrl("WEBHOOK_URL")
.setTitle("This is a test embed title!")
.setDescription("This is a test embed description!")
.setColor(12370112) // Gray color (RGB)
.setFooter("Small text at the bottom of the embed")
.build();
/* This sends the actual embed */
/* This gives you the freedom to build the embed early */
/* and send it later on in your code whenever you want */
DiscordPayload.inject(builder);
}
}This will be the result of our code after calling the testMethod with
the correct webhook url.
