Matthiesen Core Webhooks

模组

· 作者 Adammatthiesen

一个用于 Matthiesen Lib 项目的服务端库模组,旨在让发送 Discord Webhook 变得轻松便捷!

0 本站下载 0 关注 更新于 1 个月前

需要前置:Matthiesen Core

最新 1.2.1 · 1.21.1 · Fabric

一键开服(送7天)

Matthiesen Core Webhooks

Matthiesen Core

这是 Matthiesen Core 的服务端库模组,提供 Discord 网页钩子(Webhook)功能。它允许其他模组通过 Matthiesen Core 的网页钩子服务向 Discord 频道发送消息。


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));
    }
}

依赖

版本兼容性

Minecraft Version Matthiesen Core Version Mod Version
1.21.1 Unsupported 1.0.0+
1.21.1 1.x.x 1.2.0+

在 v1.2.0 之前,此模组是作为 Matthiesen Lib API 的插件构建的,该插件现已弃用。请更新到最新的 Matthiesen Core 和此模组以继续获得支持。

许可证

MIT - 见 LICENSE。

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源