Matthiesen Core Webhooks

Quick rating

Community listing page, reviews here may not be monitored by the author.

Matthiesen Core Webhooks

No reviews yet

A Server-side library mod for Matthiesen Lib projects that want to be able to send discord webhooks easily!

Mod Loaders
Minecraft

About

Description

Matthiesen Core Webhooks

Matthiesen Core

This is a server-side library mod for Matthiesen Core that provides Discord webhook functionality. It allows other mods to send messages to Discord channels via the Matthiesen Core webhook service.


import dev.matthiesen.matthiesen_core.common.api.discord.WebhookNotifierInstance;
import dev.matthiesen.matthiesen_core.common.core.MatthiesenCoreCommon;

public class ExampleWebHook {
    private WebhookNotifierInstance webhookNotifierInstance;
    
    public ExampleWebHook() {
        var webhookNotifierService = MatthiesenCoreCommon.INSTANCE.getWebhookService();
        if (!webhookNotifierService.isAvailable()) {
            throw new IllegalStateException("Webhook service is not available");
        }
        webhookNotifierInstance = webhookNotifierService.makeInstance("https://discord.com/api/webhooks/your-webhook-url");
    }
    
    public void sendMessage(String message) {
        webhookNotifierInstance.sendMessage(builder -> builder.withContent(message));
    }
}

Requirements

Version Compatibility

Minecraft Version Mod Version
1.21.1 1.x.x

License

MIT - see LICENSE.