Guest User

Untitled

a guest
Nov 21st, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. [31mcrash[39m: ReferenceError: $ is not defined
  2. at client.<anonymous> (C:UsersExuviaxDesktopnode.jsbot.js:157:9)
  3. at client.emit (events.js:117:20)
  4. at C:UsersExuviaxDesktopnode.jsnode_modulestwitch-irclibraryclient.js:657:30
  5. at Object.createChannelUserData (C:UsersExuviaxDesktopnode.jsnode_modulestwitch-irclibrarydata.js:56:2)
  6. at client._handleMessage (C:UsersExuviaxDesktopnode.jsnode_modulestwitch-irclibraryclient.js:651:22)
  7. at Stream.emit (events.js:95:17)
  8. at drain (C:UsersExuviaxDesktopnode.jsnode_modulestwitch-ircnode_modulesirc-message-streamnode_modulesthroughindex.js:36:16)
  9. at Stream.stream.queue.stream.push (C:UsersExuviaxDesktopnode.jsnode_modulestwitch-ircnode_modulesirc-message-streamnode_modulesthroughindex.js:45:5)
  10. at LineStream.<anonymous> (C:UsersExuviaxDesktopnode.jsnode_modulestwitch-ircnode_modulesirc-message-streamindex.js:22:16)
  11. at LineStream.emit (events.js:95:17)
  12.  
  13. var irc = require('twitch-irc');
  14. var colors = require('colors');
  15. var jQuery = require('jQuery')
  16. var jsdom = require("jsdom");
  17. var window = jsdom.jsdom().parentWindow;
  18.  
  19. jsdom.jQueryify(window, "http://code.jquery.com/jquery-2.1.3.min.js", function () {
  20. var $ = window.$;
  21. $("body").prepend("<h1>The title</h1>");
  22. console.log($("h1").html());
  23. });
  24.  
  25. // Calling a new client..
  26. var client = new irc.client({
  27. options: {
  28. debug: true,
  29. debugIgnore: ['ping', 'chat', 'action'],
  30. logging: true,
  31. tc: 3
  32. },
  33. identity: {
  34. username: 'BotName',
  35. password: 'oauth:Code'
  36. },
  37. channels: ['#my', '#first', '#connect', '#channels']
  38. });
  39.  
  40. // Connect the client to server..
  41. client.connect();
  42.  
  43. client.addListener('chat', function(channel, user, message) {
  44. if (message.indexOf('!followers') === 0) {
  45. var channels = channel
  46. channels = channels.replace('#', '');
  47. $.getJSON('https://api.twitch.tv/kraken/channels/' + channels + '.json?callback=?', function(data) {
  48. var followers = data.followers
  49. client.say(channel, "Current Followers: " + followers);
  50. console.log("Followers for " + channel + " " + followers);
  51. });
  52. }
  53.  
  54. });
Add Comment
Please, Sign In to add comment