我想通过slack chat post API传递这样一条消息,它将遵循以下格式:
*注意*注意单词将以粗体打印,前后各有两个星号。但由于slack本身考虑*格式为粗体的单词,所以前后的星号都不打印。
我的脚本
$ch = curl_init("https://slack.com/api/chat.postMessage");
$data = http_build_query([
"token" => "*******",
"channel" => '#notifications-test',
"text" => '*Attention* `@channel` - Please inform the client. 75% of monthly hours have been used.'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);请帮帮忙
发布于 2017-02-22 20:22:49
使用"mrkdwn": false属性。这将关闭Slack中的自动格式化。
https://stackoverflow.com/questions/42385225
复制相似问题