Getting Started
What is Matthiesen Lib Webhooks?
Section titled “What is Matthiesen Lib Webhooks?”Matthiesen Lib Webhooks is a server-side library mod for Matthiesen Lib projects that want to be able to send Discord webhooks easily! It provides a simple API for sending webhooks with support for embeds, attachments, and more, all without needing to add an additional dependency on a full Discord API wrapper.
Basic Example Usage
Section titled “Basic Example Usage”import dev.matthiesen.common.matthiesen_lib_webhooks.MatthiesenLibWebhooks;
public class Example { public static final MatthiesenLibWebhooks.Webhooks webhooks = new MatthiesenLibWebhooks.Webhooks("https://discord.com/api/webhooks/...");
public void sendWebhookTests() { webhooks.sendMessage(message -> message .withUsername("My Mod") .withContent("Simple webhook message"));
webhooks.sendMessage(message -> message .withUsername("My Mod") .addEmbed(embed -> embed .withTitle("Status Update") .withDescription("Everything is online") .addField("Players", "12", true) .addField("TPS", "20.0", true) )); }}