title: Discord Bot to notify when twitch streams are live with JS
body: <p>I am trying to create a discord bot that notifies people when a channel goes live. I have found similar questions with answers but for some reason jquery does not seem to work and I am required to use getJSON. </p>
  
  <p>Here is my index.js file.</p>
  
  <pre><code>const Discord = require('discord.js');
  
  const commando = require('discord.js-commando');
  const bot = new commando.Client();
  
  const BotToken = "bottoken";
  const TwitchClientID = "twitchclientID";
  const TwitchURL = "https://api.twitch.tv/kraken/streams/channelname";
  const channelName = "channelname";
  
  bot.registry.registerGroup('random', 'Random');
  bot.registry.registerDefaults
  bot.registry.registerCommandsIn(__dirname + "/commands");
  
  bot.login('login'); 
  
  bot.on("message", function(message) {
      if (message.content === "!Live") {
          getJSON("https://api.twitch.tv/kraken/streams/channelname", function(err, res) {
              if (res.stream == null) {
                  mybot.reply(message, "currently not live");
              } else {
                  mybot.reply(message, "currently live");
              }
          });
      }
  });
  </code></pre>
  
  <p>I have also tried jQuery.getJSON and $.getJSON. They all compile but when I do !Live the bot crashes and gives getJSON is not defined.</p>
  
  <p>Here is my package.json file.</p>
  
  <pre><code>{
    "name": "name",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
      "discord.js": "^11.1.0",
      "discord.js-commando": "^0.9.0",
      "jquery": "^3.2.1",
      "xmlhttprequest": "^1.8.0"
    }
  }
  </code></pre>
  
  <p>I'm not sure why I cant get getJSON to work as this solution should work. Any help is appreciated, sorry if it seems like a silly question, I'm new to js and using other API's.</p>