title: twitch js bot subscription response
body: <p>I am writing a bot for the twitch platform, and I want to make it respond to users who have subscribed to the channel.</p>
  <p>I found USERNOTICE for this in the documentation <a href="https://dev.twitch.tv/docs/irc/commands#usernotice" rel="nofollow noreferrer">https://dev.twitch.tv/docs/irc/commands#usernotice</a></p>
  <p>But I didn't quite understand how to use it.</p>
  <p>Something like this?</p>
  <pre><code>client.on(&quot;message&quot;, () =&gt; {
      client.say(config.get('channel'), '/usernotice message');
  });
  </code></pre>
  <p>Just call the <code>/usernotice</code> command and it should respond to this subscription message?</p>
  <p>It's just difficult to test all this and I would like to have a more or less specific solution.</p>
  <p><strong>UPDATE</strong></p>
  <p>Also in old documentation I found this code</p>
  <pre><code>chatClient.onSub((channel, user) =&gt; {
      chatClient.say(channel, `Thanks to @${user} for subscribing to the channel!`);
  });
  
  chatClient.onResub((channel, user, subInfo) =&gt; {
      chatClient.say(channel, `Thanks to @${user} for subscribing to the channel for a total of ${subInfo.months} months!`);
  });
  
  chatClient.onSubGift((channel, user, subInfo) =&gt; {
      chatClient.say(channel, `Thanks to ${subInfo.gifter} for gifting a subscription to ${user}!`);
  });
  </code></pre>
  <p>But it throws an error - TypeError: client.onSub is not a function</p>
  <p>Is there any way to use it now?</p>
  <pre><code>chatClient.on('sub', (channel, user) =&gt; {
      chatClient.say(channel, `Thanks to @${user} for subscribing to the channel!`);
  });
  </code></pre>