通过 webhook 发送的 Slack 消息中出现不需要的表情符号

An unwanted emoji is showing up in Slack messages sent through to webhook

我到处搜索寻找其他有此问题的人,但找不到任何东西。

问题是我正在尝试使用 Shopify 订单号从 php 脚本向我的松弛频道发送消息。除了一件事之外,它的工作正常,它在消息中添加了一个红色方块表情符号,我不明白为什么。

消息如下:

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 会自动发布十六进制颜色的预览。事实证明,这个特定的商店代码与十六进制颜色匹配。

是否可以在 slack 中显示没有十六进制代码的消息。我的意思是,当在输入区域使用十六进制代码输入消息时,消息一发布,就应该只显示红色尖叫声。 类似于表情符号的使用