DiscordIO

DiscordIO

与discord白名单,与discord封禁。服务器启动/停止时获取通知。在discord中获取minecraft消息。 Fabric/Velocity

管理

⚠️ 警告 ⚠️
本项目仍在开发中。可能仍存在缺陷/崩溃问题!(请在 github.com 上报告)
如果你要升级到较新版本,你需要自行升级你的 language.yml 和 config.yml(data.yml 会自动完成)。

功能特性

  • 同时适用于 Velocity 代理和 Fabric 服务器
  • 白名单功能,允许用户通过 Discord 提交白名单请求
  • (解)封禁功能,用于惩罚那些捣乱的人(多次踢出、永久封禁或封禁指定时长)
  • 高度可配置(查看 config.yaml 和 language.yml 了解所有可调整的内容)
  • 维护模式,除配置中指定的玩家外禁止所有人加入服务器,并禁用所有事件消息
  • 自定义服务器启动和停止时的 Discord 消息
  • 自定义玩家连接和断开时的 Discord 消息
  • 自定义玩家在 Minecraft 中发言时的 Discord 消息
  • 自定义用户在 Discord 中发言时的 Minecraft 消息

配置文件:

config.yml 版本 0.8.0

查看 github.com 获取最新版本

# !使用此插件前必须先配置此文件!
# 一旦启用了某个功能,再次禁用它可能会导致未定义行为
# 如果你确实想禁用某个功能,但这会破坏你的白名单/安装,你应该删除 data.yml 文件

# 查看 https://modrinth.com/plugin/discordio 了解如何获取 token
botToken:   "在此处填入你的 token,查看 https://modrinth.com/plugin/discordio 了解如何获取 token"
# 添加命令需要 Guild ID
guildId:    "在此处填入你的 guild id(你的 Discord 服务器的 ID)"

# 游戏内事件的 Discord 消息
events:
  # 服务器启动消息
  onStart:
    enabled: false
    channel: "id..."

  # 服务器停止消息
  onStop:
    enabled: false
    channel: "id..."

  # 玩家加入消息
  onJoin:
    enabled: false
    channel: "id..."

  # 玩家离开消息
  onLeave:
    enabled: false
    channel: "id..."

  # 转发 discord/minecraft 消息
  onMessage:
    enabled: false
    minecraftToDiscord: true
    discordToMinecraft: true

    # 取消注释适用于你的服务器类型的那个:

    # 对于 fabric:
    # channels:
    #   fabric: "id..."

    # 对于 velocity
    # (服务器名称是你在 velocity.toml 文件中配置的名称)
    # 如果启用了 discordToMinecraft,请不要共享 Discord 频道
    # channels:
    #   server1: "id..."
    #   server2: "id..."

# 如果启用,将使用在 mojang 注册的 UUID 进行验证
# !服务器必须处于在线模式才能使用此功能!
# 一旦有人被加入白名单后,你目前无法更改此设置,所以请谨慎选择
# 如果你确实想更改此设置,请删除 data.yml 文件(这将移除所有已加入白名单的玩家,他们需要重新加入白名单)
useUUID: true
# 如果启用,每个 Discord 用户只允许一个 Minecraft 账号
# 一旦有人被加入白名单后,你目前无法更改此设置,所以请谨慎选择
# 如果你确实想更改此设置,请删除 data.yml 文件(这将移除所有已加入白名单的玩家,他们需要重新加入白名单)
connectAccounts: true

# 如果设置为 false,此插件将在关闭时删除所有可交互消息,然后在启动时重新发送它们
# 如果设置为 true,此插件将在关闭时禁用所有可交互消息,然后在启动时重新启用它们(这样服务器启动时就不会有烦人的 ping)
disableOnShutdown: true

# 将白名单、封禁和解封请求消息合并为一条请求消息
squashedRequest:
  enabled: false
  channel: "id..."

# 通过 Discord 进行白名单管理
whitelist:
  enabled: false

  # 此插件是否应给予已加入白名单的人一个特殊角色
  giveRoleOnWhitelist: false
  # 玩家加入白名单时给予的角色(仅在 giveRoleOnWhitelist=true 时生效)
  # 启用开发者选项以便从 Discord 服务器设置中轻松获取角色 ID:
  whitelistedRoleID: ""

  onAccept:
    enabled: true
    channel: "id..."
  onDeny:
    enabled: true
    channel: "id..."
  request:
    enabled: true
    channel: "id..."
    checkRoles: false
    allowedRoles: []
  voting:
    # 如果禁用,请求将意味着立即加入白名单
    enabled: true
    channel: "id.."
    checkRoles: false
    allowedRoles: []
    acceptVotes: "50%"
    denyVotes: "1"

# 通过 Discord 进行封禁管理
banning:
  enabled: false

  # 此插件是否应给予被封禁的人一个特殊角色
  giveRoleOnBan: false
  # 玩家被封禁时给予的角色(仅在 giveRoleOnBan=true 时生效)
  # 启用开发者选项以便从 Discord 服务器设置中轻松获取角色 ID:
  bannedRoleID: ""

  onAccept:
    enabled: true
    channel: "id..."
  onDeny:
    enabled: true
    channel: "id..."
  request:
    enabled: true
    channel: "id..."
    checkRoles: false
    allowedRoles: []
    # 选择以下方式之一,让用户选择他们想要封禁谁:
    # - "discord" 选择他们想要封禁的 Discord 用户名(如果 connectAccounts=false 则无法使用)
    # - "minecraft" 选择他们想要封禁的 Minecraft 用户名
    identifier: "discord"
  punishment:
    # 如果禁用,请求将直接进入选择原因的永久封禁请求流程
    enabled: true
    channel: "id..."
    checkRoles: false
    allowedRoles: []
    acceptVotes: "50%"
    denyVotes: "1"
    punishments:
      # 如果你不保留 none 惩罚,管理员将无法拒绝封禁请求
      "None":
        type: None
      "Permanent ban":
        type: PermBan
      "5m ban":
        type: Ban
        duration: 300
      "1h ban":
        type: Ban
        duration: 3600
      "2h ban":
        type: Ban
        duration: 7200
      "1d ban":
        type: Ban
        duration: 86400
      "kick 1x":
        type: Kick
        duration: 1
      "kick 3x":
        type: Kick
        duration: 3
      "No unban 2h":
        type: NoUnban
        duration: 7200
  reason:
    # 如果禁用,请求将保留请求的原因
    enabled: true
    channel: "id..."
    checkRoles: false
    allowedRoles: []
    acceptVotes: "50%"
    denyVotes: "1"

# 通过 Discord 进行解封管理
unban:
  enabled: false

  onAccept:
    enabled: true
    channel: "id..."
  onDeny:
    enabled: true
    channel: "id..."
  request:
    enabled: true
    channel: "id..."
    checkRoles: false
    allowedRoles: []
  voting:
    # 如果禁用,请求将意味着立即解封
    enabled: true
    channel: "id.."
    checkRoles: false
    allowedRoles: []
    acceptVotes: "50%"
    denyVotes: "1"

maintenance:
  # 禁用事件并拒绝所有不在 crew 列表中的玩家
  enabled: false
  # 从配置中启用维护模式:
  inMaintenance: false
  # 维护期间允许加入的玩家
  # 如果 useUUID=true 则使用 UUID,否则使用玩家名称
  # 这不会覆盖白名单和封禁功能,你仍然需要加入白名单才能进入
  # UUID 不应包含短横线,例如:123456789abcdefghijklmni12345678
  crew: ["player1", "player2"]
  # 通过 Discord 启用维护模式的命令
  command:
    enabled: false
    checkChannel: false
    allowedChannels: ["id..."]
    checkRoles: false
    allowedRoles: []
  # 启动消息
  onStart:
    enabled: false
    channel: "id..."
  # 结束消息
  onStop:
    enabled: false
    channel: "id..."

# 一个 Discord 命令,用于查看某人是否在白名单中(以及该人是否有惩罚)
infoCommand:
  enabled: false
  checkChannel: false
  allowedChannels: ["id..."]
  checkRoles: false
  allowedRoles: []
language.yml 版本 0.8.0

查看 github.com 获取最新版本

embeds:
  #
  # *************************************************************************
  #  事件                                                                   *
  # *************************************************************************
  #
  events:
    embeds:
      onStart:
        title: "-------------[在线]-------------"
        description: ":green_circle: **代理** 已上线!"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      onStop:
        title: "-------------[离线]-------------"
        description: ":no_entry: **代理** 已离线!"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      onJoin:
        title: "-------------[已连接]-------------"
        description: "**${PLAYER_NAME}** 加入了服务器!"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/240.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      onLeave:
        title: "-------------[已断开]-------------"
        description: "**${PLAYER_NAME}** 离开了服务器!"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/240.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      onMessage:
        description: "[${PLAYER_NAME}] ${MESSAGE}"

#
  # *************************************************************************
  #  合并请求                                                               *
  # *************************************************************************
  #

  squashedRequest:
    embeds:
      request:
        title: "你想请求什么吗?"
        description: "点击下方按钮来**加入白名单**、请求**封禁**或请求**解封**"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          whitelist:
            label: "请求白名单"
            emoji: "U+2705"
          ban:
            label: "请求封禁"
            emoji: "U+2705"
          unban:
            label: "请求解封"
            emoji: "U+2705"
        color: "blue"

#
  # *************************************************************************
  #  白名单                                                                 *
  # *************************************************************************
  #
  whitelist:
    embeds:
      alreadyWhitelisted:
        title: "抱歉,你已经提交了白名单请求。"
        description: "你要么已经在白名单中,要么之前提交的请求正在审批中。请耐心等待"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      request:
        title: "请求访问权限"
        description: "你也想加入白名单吗?\n点击下方按钮请求访问 Minecraft 服务器!"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          button:
            label: "请求白名单"
            emoji: "U+2705"
        color: "BLUE"

      notAllowed:
        title: "你不被允许请求加入白名单(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      requestConfirm:
        title: "这是你吗?"
        description: "检查下方的皮肤是否来自你的账号 **${PLAYER_NAME}**"
        imageUrl: "https://minotar.net/body/${PLAYER_NAME}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          confirm:
            label: "这是我"
            emoji: "U+2705"
          cancel:
            label: "取消"
            emoji: "U+26D4"
        color: "BLUE"

      notFound:
        title: "未找到你的玩家"
        description: "在 Mojang 服务器上未找到你的玩家"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      requestCanceled:
        title: "请求已取消"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      requestConfirmed:
        title: "你的请求将由管理员审核"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      voting:
        title: "白名单请求"
        description: "Discord 用户 <@${DISCORD_UUID}> 希望将其 Minecraft 账号 **${PLAYER_NAME}** 加入白名单。\n**${ACCEPT_VOTES}** 票赞成,**${DENY_VOTES}** 票反对。(需要 ${MIN_ACCEPT_VOTES} 票才能通过,需要 ${MIN_DENY_VOTES} 票才能拒绝该请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          accept:
            label: "接受"
            emoji: "U+2705"
          deny:
            label: "拒绝"
            emoji: "U+26D4"
        color: "GREEN"

      votingDenied:
        title: "白名单请求 - 已拒绝"
        description: "用户 <@${DISCORD_UUID}> 将 **${PLAYER_NAME}** 加入白名单的请求已被拒绝"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      votingAccepted:
        title: "白名单请求 - 已接受"
        description: "用户 <@${DISCORD_UUID}> 将 **${PLAYER_NAME}** 加入白名单的请求已被接受"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      votingNotAllowed:
        title: "你不被允许投票(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      publicDenied:
        title: "白名单已拒绝"
        description: "**${PLAYER_NAME}** 未能加入白名单\n(由 <@${DISCORD_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      publicAccepted:
        title: "白名单已接受"
        description: "**${PLAYER_NAME}** 已加入白名单\n(由 <@${DISCORD_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

  #
  # *************************************************************************
  #  封禁                                                                   *
  # *************************************************************************
  #
  banning:
    embeds:
      request:
        title: "请求惩罚"
        description: "有人很烦人吗?\n点击下方按钮请求封禁"
        actions:
          button:
            label: "请求封禁"
            emoji: "U+2705"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      alreadyRequested:
        title: "抱歉,你已经提交了封禁请求。"
        description: "你之前提交的封禁请求正在审批中。请耐心等待"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      playerNotFound:
        title: "该 Discord 用户未注册"
        description: "该 Discord 用户没有关联的 Minecraft 账号。请求已被忽略"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      requestNotAllowed:
        title: "你不被允许请求封禁(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      requestConfirm:
        title: "你想封禁此用户吗?"
        description: "1. 你是否想要以以下原因请求封禁 **${PLAYER_NAME}**:'*${REASON}*'。\n2. 检查下方的皮肤是否来自账号 **${PLAYER_NAME}**"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        actions:
          confirm:
            label: "就是他"
            emoji: "U+2705"
          cancel:
            label: "取消"
            emoji: "U+26D4"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      requestNotFound:
        title: "未找到该用户"
        description: "未找到与该 Discord 用户关联的账号"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      requestCanceled:
        title: "请求已取消"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      requestConfirmed:
        title: "你的请求将由管理员审核"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      punishmentPicker:
        title: "封禁请求 - 惩罚"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望将 Minecraft 账号 **${PLAYER_NAME}** 封禁,原因如下:\n\"${REASON}\""
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          punishment:
            label: "惩罚"
        color: "ORANGE"

      punishmentVoting:
        title: "封禁请求 - 惩罚"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望将 Minecraft 账号 **${PLAYER_NAME}** 封禁,原因如下:\n\"${REASON}\"。\n <@${ADMIN_UUID}> 建议 **${PUNISHMENT}** \n**${ACCEPT_VOTES}** 票赞成,**${DENY_VOTES}** 票反对。(需要 ${MIN_ACCEPT_VOTES} 票才能通过,需要 ${MIN_DENY_VOTES} 票才能拒绝该请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          accept:
            label: "接受"
            emoji: "U+2705"
          deny:
            label: "拒绝"
            emoji: "U+26D4"
        color: "ORANGE"

      punishmentDecided:
        title: "封禁请求 - 惩罚"
        description: "**${PLAYER_NAME}** 将受到以下惩罚:**${PUNISHMENT}**"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      punishmentVotingNotAllowed:
        title: "你不被允许投票(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      reasonPicker:
        title: "封禁请求 - 原因"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望 Minecraft 账号 **${PLAYER_NAME}** 受到 ${PUNISHMENT} 惩罚,原因如下:\n\"${ORIGINAL_REASON}\"。此原因被拒绝,原因应该是什么?"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          change:
            label: "更改原因"
        color: "ORANGE"

      reasonFirstVote:
        title: "封禁请求 - 原因"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望 Minecraft 账号 **${PLAYER_NAME}** 受到 ${PUNISHMENT} 惩罚,原因如下:\n\"${REASON}\"。\n 这是一个好的**原因**吗? \n**${ACCEPT_VOTES}** 票赞成,**${DENY_VOTES}** 票反对。(需要 ${MIN_ACCEPT_VOTES} 票才能通过,需要 ${MIN_DENY_VOTES} 票才能拒绝该请求)"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          accept:
            label: "接受"
            emoji: "U+2705"
          deny:
            label: "拒绝"
            emoji: "U+26D4"
        color: "ORANGE"

      reasonVoting:
        title: "封禁请求 - 更改原因"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望 Minecraft 账号 **${PLAYER_NAME}** 受到 ${PUNISHMENT} 惩罚,原因如下:\n\"${ORIGINAL_REASON}\"。\n\n <@${ADMIN_UUID}> 建议将原因更改为 \"${REASON}\" \n\n**${ACCEPT_VOTES}** 票赞成,**${DENY_VOTES}** 票反对。(需要 ${MIN_ACCEPT_VOTES} 票才能通过,需要 ${MIN_DENY_VOTES} 票才能拒绝该请求"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          accept:
            label: "接受"
            emoji: "U+2705"
          deny:
            label: "拒绝"
            emoji: "U+26D4"
        color: "ORANGE"

      reasonDecided:
        title: "封禁请求 - 已接受"
        description: "**${PLAYER_NAME}** 将受到以下惩罚:**${PUNISHMENT}**。原因是 \"${REASON}\""
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      reasonVotingNotAllowed:
        title: "你不被允许投票(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      publicDenied:
        title: "惩罚已拒绝"
        description: "**${PLAYER_NAME}** 未受到惩罚\n(由 <@${REQUESTER_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      publicAccepted:
        title: "惩罚已接受"
        description: "**${PLAYER_NAME}** 受到了 *${PUNISHMENT}* 惩罚,因为 '*${REASON}*'\n(由 <@${REQUESTER_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

  #
  # *************************************************************************
  #  解封                                                                   *
  # *************************************************************************
  #
  unban:
    embeds:
      alreadyRequested:
        title: "抱歉,你已经提交了解封请求。"
        description: "你之前提交的封禁请求正在审批中。请耐心等待"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      notBanned:
        title: "你没有被封禁。"
        description: "你没有被封禁,所以无法请求解封。(可怜的你)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      playerNotFound:
        title: "你尚未注册为 Minecraft 玩家"
        description: "请先将自己加入白名单,然后再尝试解封。请求已被忽略"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "BLUE"

      request:
        title: "请求解封"
        description: "你想被解封吗?\n点击下方按钮请求解封!"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          button:
            label: "请求解封"
            emoji: "U+2705"
        color: "YELLOW"

      notAllowed:
        title: "你不被允许请求解封(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      noUnbanPunishment:
        title: "你不被允许请求解封(你有一个不允许解封的惩罚)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      requestPlayerPicker:
        title: "选择你想为谁请求解封"
        description: "使用附加的选择器选择一位玩家:"
        actions:
          minecraftUser:
            label: "Minecraft 账号"
        color: "BLUE"

      requestConfirm:
        title: "你想解封以下玩家吗?"
        description: "1. 你是否想要以以下原因请求移除 **${PLAYER_NAME}** 的 **${PUNISHMENT_NAME}**:'*${REASON}*'。\n2. 检查下方的皮肤是否来自账号 **${PLAYER_NAME}**"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          confirm:
            label: "这是我"
            emoji: "U+2705"
          cancel:
            label: "取消"
            emoji: "U+26D4"
        color: "BLUE"

      requestCanceled:
        title: "请求已取消"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      requestConfirmed:
        title: "你的请求将由管理员审核"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"

      voting:
        title: "解封请求"
        description: "Discord 用户 <@${REQUESTER_UUID}> 希望从其 Minecraft 账号 **${PLAYER_NAME}** 移除惩罚 **${PUNISHMENT_NAME}**。\n 他给出了以下原因:\n *${REASON}* \n\n**${ACCEPT_VOTES}** 票赞成,**${DENY_VOTES}** 票反对。 \n(需要 ${MIN_ACCEPT_VOTES} 票才能通过,需要 ${MIN_DENY_VOTES} 票才能拒绝该请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        actions:
          accept:
            label: "接受"
            emoji: "U+2705"
          deny:
            label: "拒绝"
            emoji: "U+26D4"
        color: "YELLOW"

      votingDenied:
        title: "解封请求 - 已拒绝"
        description: "用户 <@${REQUESTER_UUID}> 从 **${PLAYER_NAME}** 移除惩罚 **${PUNISHMENT_NAME}** 的请求已被拒绝"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      votingAccepted:
        title: "解封请求 - 已接受"
        description: "用户 <@${REQUESTER_UUID}> 从 **${PLAYER_NAME}** 移除惩罚 **${PUNISHMENT_NAME}** 的请求已被接受"
        imageUrl: "https://minotar.net/helm/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      votingNotAllowed:
        title: "你不被允许投票(你没有正确的 Discord 角色)"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      publicDenied:
        title: "解封已拒绝"
        description: "**${PLAYER_NAME}** 的惩罚 *${PUNISHMENT_NAME}* 未被移除。\n(由 <@${REQUESTER_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "RED"

      publicAccepted:
        title: "解封已接受"
        description: "**${PLAYER_NAME}** 的惩罚 *${PUNISHMENT_NAME}* 已被移除。\n(由 <@${REQUESTER_UUID}> 请求)"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

  #
  # *************************************************************************
  #  维护模式                                                               *
  # *************************************************************************
  #

  maintenance:
    embeds:
      onStart:
        title: "------------[维护]------------"
        description: "抱歉,服务器处于维护模式,你目前无法加入"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "YELLOW"

      onStop:
        title: "------------[维护]------------"
        description: "服务器已恢复在线,维护已结束。"
        footer:
          message: "${CURRENT_DATE} ${CURRENT_TIME}"
        color: "GREEN"

      notAllowed:
        title: "抱歉,你不被允许使用此命令"

      wrongChannel:
        title: "抱歉,你不能在此频道使用此命令"

      incomplete:
        title: "请指定机器人应该启动还是停止维护模式"
        color: "RED"

      command:
        title: "遵命,老板"

  #
  # *************************************************************************
  #  信息命令                                                               *
  # *************************************************************************
  #

  infoCommand:
    embeds:
      notAllowed:
        title: "抱歉,你不被允许使用此命令"

      wrongChannel:
        title: "抱歉,你不能在此频道使用此命令"

      incomplete:
        title: "请指定一个用户,命令参数不完整"
        color: "RED"

      notRegistered:
        title: "该 Discord 用户未在服务器中注册"
        description: "<@${DISCORD_UUID}> 没有已加入白名单的 Minecraft 账号"
        color: "BLUE"

      command:
        title: "*${PLAYER_NAME}*"
        description: "${PLAYER_NAME},由 <@${DISCORD_UUID}> 注册。\n 此玩家有以下惩罚:\n"
        imageUrl: "https://minotar.net/body/${PLAYER_KEY}/100.png"
        # Extra 用于为每个惩罚在描述中添加一行:
        extra: "- *${PUNISHMENT_NAME}* 直到 *${PUNISHMENT_UNTIL}*\n"
        color: "BLUE"

#
# *************************************************************************
#  模态框                                                                 *
# *************************************************************************
#
modals:
  whitelist:
    modals:
      request:
        title: "白名单请求"
        actions:
          username:
            label: "用户名"
            placeholder: "Steve1234"

  banning:
    modals:
      request:
        title: "封禁请求"
        actions:
          discordUser:
            label: "Discord 用户"
          minecraftUser:
            label: "Minecraft 账号"
          reason:
            label: "原因"
            placeholder: "请给出你想要封禁此玩家的充分理由"
      reasonChange:
        title: "更改原因"
        actions:
          reason:
            label: "原因"
            placeholder: "${ORIGINAL_REASON}"
            value: "${ORIGINAL_REASON}"
  
  unban:
    modals:
      request:
        title: "解封请求"
        actions:
          punishment:
            label: "惩罚"
          reason:
            label: "原因"
            placeholder: "请给出你想要被解封的充分理由"

#
# *************************************************************************
#  命令                                                                   *
# *************************************************************************
#
commands:
  maintenance:
    name: "maintenance"
    description: "用于启动或停止维护模式的命令"
    options:
      startStop:
        name: "start-stop"
        description: "启动或停止维护模式"
        options: ["start", "stop"]
  info:
    name: "player-info"
    description: "用于显示玩家信息的命令"
    options:
      subcommandMinecraft:
        name: "minecraft"
        description: "获取 Minecraft 玩家的信息"
      subcommandDiscord:
        name: "discord"
        description: "获取 Discord 用户的信息"
      minecraftUser:
        name: "minecraft-user"
        description: "你想要获取信息的 Minecraft 用户"
      discordUser:
        name: "discord-user"
        description: "你想要获取信息的 Discord 用户"

下载

前往 modrinth.com 下载此模组

安装设置

查看 discord.com/developers/docs/quick-start/getting-started 了解更多信息。

  1. 启动你的(fabric 或 velocity)服务器,然后再次停止它
  2. 服务器将生成 mods 或 plugin 文件夹,将与你服务器类型对应的 jar 文件放入该文件夹(前往 modrinth.com 下载)
  3. 再次启动你的服务器,此模组将为你生成一个 config.yml 文件,打开它(以下步骤将指导你进行配置)
  4. 前往 Discord 开发者门户 discord.com/developers/applications
  5. 点击 "New application" 访问 discord.com/developers/applications 时 Discord 面板的照片
  6. 选择一个名称并接受用户协议 点击 "New application" 后 Discord 面板的照片
  7. 使用侧边栏前往 bots 部分 创建机器人后 Discord 面板的照片
  8. 点击 reset token 并点击确认 Discord 面板 bots 部分的照片
  9. 复制你的机器人 token 并将其粘贴到配置的 botToken 字段中 ![config.yaml 文件的照片](https://cdn