Skip to content
zheng sen he edited this page Jan 10, 2024 · 3 revisions

事件

PlayerChatMessage.yml

# 聊天转播频道
channel: '闲聊频道'

message:
  # kook内消息格式
  kook: |
    [
      {
        "type": "card",
        "theme": "secondary",
        "size": "lg",
        "modules": [
          {
            "type": "section",
            "text": {
              "type": "kmarkdown",
              "content": "(font){player} 说: (font)[success] {message} (font)(游戏内)(font)[pink]"
            }
          }
        ]
      }
    ]
  # 游戏内消息
  minecraft: '&f[&a闲聊频道&f] &f{user}: &7{message}'

PlayerJoinMessage.yml

# 玩家加入服务器事件

# 使用频道
channels:
  - '公告频道'

message:
  quit: |
    [
      {
        "type": "card",
        "theme": "info",
        "size": "sm",
        "modules": [
          {
            "type": "section",
            "text": {
              "type": "plain-text",
              "content": "{player} 退出了游戏"
            },
            "mode": "left",
            "accessory": {
              "type": "image",
              "src": "https://minotar.net/avatar/{player}/32.png",
              "size": "sm"
            }
          }
        ]
      }
    ]

  join: |
    [
      {
        "type": "card",
        "theme": "info",
        "size": "sm",
        "modules": [
          {
            "type": "section",
            "text": {
              "type": "plain-text",
              "content": "{player} 加入了游戏"
            },
            "mode": "left",
            "accessory": {
              "type": "image",
              "src": "https://minotar.net/avatar/{player}/32.png",
              "size": "sm"
            }
          }
        ]
      }
    ]

其他

卡片消息

你可以通过编辑json来更改机器人发送的消息样式

kook提供了一个方便的工具 卡片消息编辑器

image

Clone this wiki locally