通过 Webhook 将嵌入从脚本发送到 Discord - 组件不起作用

问题描述 投票:0回答:1

我遇到了一个问题,我也通过 -curl 进行了测试,没有其他结果。 基本上我发送的是这样的 json:

  "embeds": [
    {
      "title": "A title",
      "description": "A description",
      "color": 16711680,
      "fields": [
        {
          "name": "first name",
          "value": "value",
          "inline": true
        },
        {
          "name": "second name",
          "value": "value",
          "inline": true
        },
        {
          "name": "third name",
          "value": "value",
          "inline": true
        }
      ],
      "footer": {
        "text": "Powered by xxx",
        "icon_url": "a url"
      }
    }
  ],
  "components": [
    {
      "type": 1,
      "components": [
        {
          "type": 2,
          "label": "Click me!",
          "style": 5,
          "url": "a link"
        }
      ]
    }
  ]
}

它工作正常,但我无法显示消息中组件的按钮,也无法显示应用程序脚本或 -curl 的按钮

有人可以帮我吗?

javascript discord webhooks
1个回答
0
投票

已解决 您不能使用仅 Webhook 的“组件”。 它需要应用程序拥有的 webhook

© www.soinside.com 2019 - 2024. All rights reserved.