title: Slackbot (Node): icon_emoji feature not working
body: <p>My req payload to the Slack API using the <code>icon_emoji</code> feature of this API is not correct. The expected behavior is to have an emoji being <code>:smile:</code> to be displayed as my Slackbot's icon image whenever the bot posts a message to the channel. The current behavior is a default Slack image instead of the <code>:smile:</code>. I don't presently see what I am doing wrong. This is my fourth attempt across months at correcting this possibly so I would appreciate any advice here.</p>
  
  <p>Here is my code, "as_user" has to be set to true for this to work per the <a href="https://api.slack.com/methods/chat.postMessage" rel="nofollow noreferrer">documentation for posting messages.</a>  </p>
  
  <p>Here is my index.js file:</p>
  
  <pre><code>const fetch = require("node-fetch"),
        config = require("../config.js"),
        icon = ":smile:";
  
  
  module.exports = {
      postMessage: (message) =&gt; {
          if(!config.SLACK_CONFIG.webhook_url) {
              throw Error("Please set SLACK_MEETUP_WEBHOOK_URL");
          }
  
  return fetch(config.SLACK_CONFIG.webhook_url, {
      method: "POST",
      headers: {
          "Content-Type": "application/json"
      },
  
     body: JSON.stringify({ text: message, "as-user": false, "icon-emoji": icon })
  }).then(res =&gt; res.text()).then((text) =&gt; {
  
      if(text !== "ok") {
          throw Error("Failed to post message to slack");
      }
  });
  }
  
  };
  </code></pre>