【发布时间】:2021-02-06 12:23:58
【问题描述】:
作为per Discord's documentation,您可以使用 Slack 的 webhook 格式。
在我目前拥有的 Laravel 应用中:
$blocks = [
[
'type' => 'section',
'text' => [
'type' => 'plain_text',
'text' => 'test',
]
]
];
$response = Http::post('https://discordapp.com/api/webhooks/.../.../slack', [
'text' => 'Title',
'blocks' => json_encode($blocks),
]);
但只有'Title' 出现在消息中,而不是$blocks 内容。 Discord 文档并未声明不支持此功能,它们引用了the Slack webhook docs,其中明确说明了如何使用块构建消息。我错过了什么?
【问题讨论】: