title: React to chat-commands (webhooks)
body: <p>So I have a pretty easy setup for a bot on discord:</p>
  
  <pre><code>&lt;?php
  
  function postToDiscord($message)
  {
      $data = array(
          "content" =&gt; $message,
          "username" =&gt; "myBot",
      );
      $curl = curl_init("https://discordapp.com/api/webhooks/MY_HOOK");
      curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      return curl_exec($curl);
  }
  
  postToDiscord("foo bar");
  </code></pre>
  
  <p>This works as expected, but I don't get the concept of these hooks. I saw <a href="https://support.discordapp.com/hc/de/articles/228383668" rel="nofollow noreferrer" title="an example">an example</a> here with github, but this reacts on actions made with github. Like, after a commit, i can trigger a webhook and post to a channel. </p>
  
  <p>However, I'd like to react to specific chat-commands like <code>!song</code> to retrieve the current song from spotify. On twitch for example, I know you can grab the current text from an IRC, but how does this work for discord? </p>
  
  <p>I think I need an observer, which reacts to a given input (maybe with an ajax-call?). Any ideas or feedback is highly appreciated.</p>