wckdDCLink

插件

· 作者 wckd

通过 WDCL 将你的 Minecraft 和 Discord 聊天连接起来

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

最新 1.0.0 · 26.2 · Paper / Purpur

一键开服(送7天)

wckdDCLink

将你的 Minecraft 聊天桥接到 Discord,反之亦然!

功能

  • Discord > Minecraft 链接
  • 通过强制链接实现 Minecraft > Discord 链接
  • 链接嵌入卡片
  • Discord 角色同步
  • 从 DiscordSRV 迁移数据
  • 支持 MiniMessage
  • 加入/离开消息
  • 如果未链接则抑制加入/离开消息

预览

链接嵌入卡片

postlinkembed link code

文件

配置文件版本 2
# Bot 令牌;来自 https://discord.com/developers/applications -> 你的应用 -> Bot -> 重置令牌
# 更改此选项后必须重启服务器
BotToken: ""

# 此 Bot 所在的 Discord 服务器(公会)ID
GuildId: ""

# 此插件可以发布的每种消息类型的通道路由。
# 语法为 Channels: {"类型": "来自 Discord 的数字通道 ID", "另一个类型": "另一个通道 ID"}
#
# 除非为特定类型定义了条目,否则所有消息类型都将发送到“global”。
# 完全省略类型的条目(或留空)使其回退到“global”。
#
# 类型:
#   global   - 聊天桥接,以及下面其他所有类型的回退
#   join     - 加入消息
#   leave    - 退出消息
#   awards   - 进度消息
#   deaths   - 死亡消息
#   watchdog - 卡顿/假死警报
#   server   - 服务器启动/停止公告
#   link     - 仅限员工:链接/取消链接确认发布的位置,用于管理员查看
#              谁链接了谁。NOT /link 命令的使用位置——见下文 LinkRequestChannelId。
#
# 更改此选项后运行 "/dclink reload" 以应用
Channels: {"global": ""}

# 控制台通道的数字 ID(非名称),留空以完全禁用控制台通道。
# 故意不包含在上述 Channels 映射中,也不能从 Discord 执行命令——原因请参见 README.md 中的安全部分。
ConsoleChannelId: ""

# ─────────────────────────────────────────────────────────────────────────
#  聊天桥接
#
#  ChatBridgeEnabled: 是否启用聊天桥接
#  ChatBridgeMinecraftToDiscordFormat: {玩家} {消息} - 仅在
#    ChatBridgeUseWebhook 为 false 时使用(Bot 发布格式化的行而不是 Webhook)
#  ChatBridgeDiscordToMinecraftFormat: {名字} {消息} - MiniMessage 或传统 (&a)
#    均可使用,自动检测
#  ChatBridgeUseWebhook: 让聊天消息以玩家身份发布。
#  需要在 Discord Developer Portal (Bot -> Privileged Gateway Intents) 为此 Bot 启用 MESSAGE CONTENT INTENT,
#  否则 Bot 将无法启动。
# ─────────────────────────────────────────────────────────────────────────
ChatBridgeEnabled: true
ChatBridgeMinecraftToDiscordFormat: "**{player}**: {message}"
ChatBridgeDiscordToMinecraftFormat: "<blue>[Discord]</blue> <white>{name}</white><gray>: </gray><white>{message}</white>"
ChatBridgeUseWebhook: false

# ─────────────────────────────────────────────────────────────────────────
#  加入/离开/进度/死亡嵌入卡片
#
#  {Join,Leave,Death,Advancement}EmbedColor: 十六进制颜色,不带 "#",仅在
#    AnnouncementsUseEmbeds 为 true 时使用。
# ─────────────────────────────────────────────────────────────────────────
AnnouncementsUseEmbeds: true
JoinEmbedColor: "57F287"
LeaveEmbedColor: "ED4245"
DeathEmbedColor: "992D22"
AdvancementEmbedColor: "FEE75C"

# ─────────────────────────────────────────────────────────────────────────
#  加入/离开消息
#
#  JoinQuitEnabled: 是否发布加入/离开消息
#  JoinFormat / QuitFormat: {玩家}
# ─────────────────────────────────────────────────────────────────────────
JoinQuitEnabled: true
JoinFormat: "**{player}** joined the server"
QuitFormat: "**{player}** left the server"

# ─────────────────────────────────────────────────────────────────────────
#  进度(奖励)消息
# ─────────────────────────────────────────────────────────────────────────
AdvancementsEnabled: true
AdvancementFormat: "**{player}** has made the advancement **{advancement}**"

# ─────────────────────────────────────────────────────────────────────────
#  死亡消息
#
#  DeathFormat: {玩家} / {死亡消息} - deathMessage 是完整的原版
#  死亡行(例如 "Player was slain by Zombie"),因此除非你想将玩家加粗或提及
#  并与原版文本分开,否则 {player} 通常是多余的。
# ─────────────────────────────────────────────────────────────────────────
DeathsEnabled: true
DeathFormat: "\u2620\ufe0f {deathMessage}"

# ─────────────────────────────────────────────────────────────────────────
#  服务器启动/停止公告
# ─────────────────────────────────────────────────────────────────────────
ServerStartStopEnabled: true
ServerStartMessage: "? Server has started."
ServerStopMessage: "? Server is shutting down."

# ─────────────────────────────────────────────────────────────────────────
#  服务器看门狗
#
#  监控自服务器上次游戏刻以来的时间。
#
#  WatchdogEnabled: 是否启用看门狗
#  WatchdogTimeoutSeconds: 最后一次刻以来多少秒后发出警报(最小值为 10)
#  WatchdogMessageCount: 警报重复的次数,以防你确实想确保捕获它
# ─────────────────────────────────────────────────────────────────────────
WatchdogEnabled: true
WatchdogTimeoutSeconds: 30
WatchdogMessageCount: 3

# ─────────────────────────────────────────────────────────────────────────
#  控制台镜像
#
#  ConsoleEnabled: 是否开启控制台镜像
#  ConsoleMinLevel: INFO, WARN 或 ERROR(Log4j 级别名称)- 仅镜像
#    在此级别及以上的记录
#  ConsoleFlushIntervalSeconds: 缓冲的行作为批次发送的频率
# ─────────────────────────────────────────────────────────────────────────
ConsoleEnabled: true
ConsoleMinLevel: "WARN"
ConsoleFlushIntervalSeconds: 5

# ─────────────────────────────────────────────────────────────────────────
#  账号绑定
#
#  LinkedFormat / UnlinkedFormat: {player} / {discordId} - 发布到上述 Channels 映射中的 "link" 频道(仅限员工可见的日志)
#  LinkRequestChannelId: 使用 /link 命令和“获取验证码”按钮所在的频道。
#    留空则允许在任何频道使用 /link。这与上述 Channels 映射中 "link" 条目是**不同**的频道——后者是记录谁绑定了谁的员工专用日志,而前者是玩家实际请求验证码的地方。
#  CodeLength / CodeExpiryMinutes / CooldownSeconds: 链接验证码的行为规则
#  ButtonId: 由 /postlinkembed 发布的“获取验证码”按钮的组件 ID
#  EmbedColor / EmbedThumbnailUrl / EmbedImageUrl: 该嵌入消息的样式设置
# ─────────────────────────────────────────────────────────────────────────
LinkEventsEnabled: true
LinkedFormat: "\u2705 **{player}** 已绑定 <@{discordId}>"
UnlinkedFormat: "\u274c **{player}** 解绑了其 Discord 账号"
LinkRequestChannelId: ""

CodeLength: 6
CodeExpiryMinutes: 15
CooldownSeconds: 30

ButtonId: "dclink_getcode"
EmbedColor: "5865F2"
EmbedThumbnailUrl: ""
EmbedImageUrl: ""

AutoDeleteEnabled: true
AutoDeleteButtonReplySeconds: 15

ConnectAttemptLimiterEnabled: true
ConnectAttemptLimiterMaxAttempts: 5
ConnectAttemptLimiterWindowSeconds: 60
ConnectAttemptLimiterLockoutSeconds: 60

# 隐藏尚未绑定的玩家的加入/离开游戏消息。
SuppressJoinQuitUntilLinked: false

# ─────────────────────────────────────────────────────────────────────────
#   Booster 检测
#
#  目前仅支持检测/占位符功能。需要在 Discord 开发者门户中为此机器人启用 SERVER MEMBERS INTENT(服务器成员意图)。
# ─────────────────────────────────────────────────────────────────────────
BoosterDetectionEnabled: true

# ─────────────────────────────────────────────────────────────────────────
#  角色同步
#
#  RoleSyncEnabled: 是否开启角色同步功能
#  RoleSyncIntervalMinutes: 每隔多久重新应用 Minecraft 组别 -> Discord 角色作为安全网,这是在每次变更时发生的实时同步之上的额外措施
#  RoleSyncGroupToRole: luckperms_group_name: "discord_role_id" 键值对
# ─────────────────────────────────────────────────────────────────────────
RoleSyncEnabled: false
RoleSyncIntervalMinutes: 10
RoleSyncGroupToRole:
  # admin: "123456789012345678"
  # donator: "123456789012345679"

# ─────────────────────────────────────────────────────────────────────────
#  昵称同步(仅 Minecraft -> Discord)
#
#  将已绑定玩家的 Discord 昵称设置为其 Minecraft 名称。
#  通过 "wckddclink.nicknamesync" 权限可针对单个玩家禁用(默认授予此权限)。
#
#  NicknameSyncEnabled: 是否开启昵称同步功能
#  NicknameSyncCycleMinutes: 每隔多少分钟为所有在线的已绑定玩家重新应用昵称,这是在绑定和加入时发生的实时同步之外的额外措施
#  NicknameSyncFormat: 昵称格式(保持在 32 个字符以内——这是 Discord 自身的限制——超出部分会被截断)
#    %displayname% - 玩家的显示名称
#    %username%    - 玩家的用户名
#    也支持 PlaceholderAPI 占位符
# ─────────────────────────────────────────────────────────────────────────
NicknameSyncEnabled: false
NicknameSyncCycleMinutes: 3
NicknameSyncFormat: "%username%"

# ─────────────────────────────────────────────────────────────────────────
#  封禁同步
#
#  在已绑定账号之间镜像 Minecraft 和 Discord 的封禁状态。每个方向均可独立开关。对于 Discord -> Minecraft 方向,需要 GUILD_MODERATION(公会管理)意图(非特权意图,会自动添加)。
#
#  BanSyncMinecraftToDiscord: 当玩家在 Minecraft 服务器被封禁时,封禁其已绑定的 Discord 账号
#  BanSyncDiscordToMinecraft: 当玩家的 Discord 账号被封禁时,在 Minecraft 服务器上封禁该玩家
#  BanSyncDiscordToMinecraftReason: 当 Discord 封禁被镜像到 Minecraft 端时显示的封禁原因
# ─────────────────────────────────────────────────────────────────────────
BanSyncMinecraftToDiscord: false
BanSyncDiscordToMinecraft: false
BanSyncDiscordToMinecraftReason: "&c由于您在我们的 Discord 服务器被封禁,您已被暂时封禁,直至进一步通知。"

# ─────────────────────────────────────────────────────────────────────────
#  要求关联账号才能游玩
#
#  重要提示:由于我们的关联流程通常从 Discord(先在 Discord 上执行 /link,然后在游戏内执行 /connect)开始,因此被此处拒绝的玩家将无法运行 /connect。所以,未关联的玩家会在踢出消息中直接获得一个全新的代码——无需在游戏内操作——并通过在私信中将此代码发送给机器人来完成关联。需要启用 DIRECT_MESSAGES + MESSAGE_CONTENT 意图(启用此项时会自动添加)——MESSAGE_CONTENT 是特权意图,如果尚未启用,请在 Discord Developer Portal 中启用它(ChatBridge 也需要此功能)。
#
#  LinkingGateEnabled: 是否开启此关卡
#  LinkingGateRequiredRoleId: 已关联账号必须拥有的 Discord 角色 ID 才能放行(类似 Twitch 订阅者风格)。留空则仅要求关联,不进行角色检查。
#  LinkingGateBypassNames: 无论何种情况始终允许进入的 Minecraft 用户名
#  LinkingGateWhitelistedPlayersBypass: 是否在服务器的原版白名单中就足以完全跳过此检查
#  LinkingGateNotLinkedMessage / NotSubscriberMessage / StartingMessage: 踢出消息。未关联的消息支持 {BOT}(机器人名称)、{CODE}(其全新验证代码)、{INVITE}(下方的 LinkingGateInviteLink)
#  LinkingGateInviteLink: 你的 Discord 服务器邀请链接,显示在未关联的踢出消息中
# ─────────────────────────────────────────────────────────────────────────
LinkingGateEnabled: false
LinkingGateRequiredRoleId: ""
LinkingGateBypassNames: []
LinkingGateWhitelistedPlayersBypass: true
LinkingGateNotLinkedMessage: "&7你必须关联你的 &9Discord&7 账号才能游玩。\n\n向 &b{BOT}&7 发送一条仅包含 &b{CODE}&7 的私信以关联你的账号。\n\nDiscord 邀请 \u00bb &b{INVITE}"
LinkingGateNotSubscriberMessage: "&c你已关联,但你还没有所需 Discord 角色来游玩。"
LinkingGateStartingMessage: "&c仍在连接 Discord 以检查你的关联状态——请稍后重试。"
LinkingGateInviteLink: ""


Messages

Discord: Cooldown: "你请求代码的速度太快了——请稍等片刻再试。" AlreadyLinked: "此 Discord 账号已关联到一个 Minecraft 账号。" CodeMessage: "你的代码是 {code}。在游戏中,于 {expiry} 分钟内运行 /connect {code}。" WrongChannel: "请使用 {channel} 来请求链接代码。" EmbedTitle: "关联你的 Minecraft 账号" EmbedDescriptionWithButton: "点击下方的按钮获取一次性代码,然后在游戏中运行 /connect <code>。" ButtonLabel: "获取代码" LinkedConfirmation: "你现在已关联到 {player}!该账号的聊天桥接和角色同步(如果启用)已生效。

Minecraft: PlayersOnly: "&c只有玩家才能使用此命令。" ConnectUsage: "&c用法: /connect " ConnectLockedOut: "&c失败尝试次数过多。请在 {seconds}s 后重试。" InvalidOrExpiredCode: "&c该代码无效或已过期。请在 Discord 中申请新的代码。" AlreadyLinked: "&c你已经关联了一个 Discord 账号。" LinkSuccess: "&a你的账号现已关联到 Discord!" RdclUsage: "&c用法: /dclink reload" RdclReloaded: "&aDCLink 配置已重新加载。" PostEmbedUsage: "&c用法: /postlinkembed [channelId](或在 config.yml 中设置 LinkChannelId)" PostedWithButton: "&a已发布链接嵌入消息。" ChannelNotFound: "&c未找到该频道——请检查 ID 并确保机器人可以看到它。" PostEmbedError: "&c发布嵌入消息失败——请查看控制台以获取详细信息。"

命令

  • postlinkembed <channel id> - 将嵌入消息发布到指定频道
  • connect <c0de> - 在游戏中使用,允许玩家关联他们的账号
  • link - 在 Discord 中使用,为玩家提供用于关联的代码
  • wdclink reload - 在完成配置更改后重新加载插件(默认:OP)
  • wdclink migrate - 用于将 DiscordSRV 数据迁移到 WCDL(默认:OP)
  • wdclink unlink - 解除玩家关联(默认:OP)
  • wdclink whois - 获取玩家关联的 Discord ID 和名称(默认:OP)
  • wdclink syncroles - 强制同步玩家角色(默认:OP)
  • wdclink boosters - 列出提升过 Discord 等级的玩家列表(默认:OP)

权限

  • wdclink.admin - 访问管理员命令(默认:OP)
  • wdclink.nicknamesync - 是否同步玩家名称(默认)

占位符 (Placeholder API)

  • %wdclink_linked% - 玩家是否已关联(yes|no)
  • %wdclink_did% - 玩家的 Discord ID
  • %wdclink_dname% - 玩家的 Discord 用户名
  • %wdclink_dtag% - 玩家的 Discord 显示名称
  • %wdclink_davatar% - Discord 头像 URL
  • %wdclink_booster% - 玩家是否为 Booster(yes|no)

进行中的功能

  • booster(开发中,当前为管理员提供占位符以在其他插件中使用)

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

评论 0

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

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源