Matthiesen Core Webhooks
这是 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。
Matthiesen Core Webhooks
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 | Matthiesen Core Version | Mod Version |
|---|---|---|
| 1.21.1 | Unsupported | 1.0.0+ |
| 1.21.1 | 1.x.x | 1.2.0+ |
Before
v1.2.0, this mod was built as an addon for Matthiesen Lib API, which is now deprecated. Please update to the latest version of Matthiesen Core and this mod for continued support.
License
MIT - see LICENSE.
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
下载 Matthiesen Core Webhooks
更新内容
- 由 @Adammatthiesen 在 中更新了依赖版本范围并优化了 README 以增强兼容性
完整变更日志:
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧