我到处搜索,想找到其他人遇到这个问题,但找不到任何东西。
问题是我正在尝试使用 Shopify 订单号从 php 脚本向我的松弛 channel 发送消息。除了一件事之外,它的工作正常,它在消息中添加了一个红色方 block 表情符号,我不明白为什么。
消息如下:
red square that shouldn't be there
这是我用来发送松弛消息的代码:
// Create a constant to store your Slack URL
define('SLACK_WEBHOOK', 'https://hooks.slack.com/services/x/x/eActr8MIhT0SIyKuGGwR0ScU');
// Make your message
$message = array('payload' => json_encode(array('text' => 'Order '.$shopify_order['name'].' has been sent to Embroidery Works' )));
// Use curl to send your message
$c = curl_init(SLACK_WEBHOOK);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $message);
curl_exec($c);
curl_close($c);
最佳答案
Worth nothing: #BA1242 is a dark-red color. You'll often see it on programmer forums when describing CSS. color-hex.com/color/ba1242 – @Chris
正如 Chris(谢谢!)指出的那样,Slack 会自动发布十六进制颜色的预览。事实证明,这个特定的商店代码与十六进制颜色相匹配。
关于php - 通过 webhook 发送的 Slack 消息中出现不需要的表情符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51392129/