Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. var tmi = require('tmi.js');
  2. var timeout = 1500;// timeout in millseconds change this
  3.  
  4. var phrases = [
  5. "Happinessltd, I love you! (No Homo) FeelsBadMan",
  6. "FailFish",
  7. "danWave",
  8. "baconNub",
  9. "sbzyFeedMe",
  10. "waffleHeart",
  11. "danPuke",
  12. "GivePLZ EVERYONE TAKE MY ENERGY! TakeNRG",
  13. "Kappa",
  14. "Happinessltd, I love you! (Full Homo) KappaPride"
  15. ];
  16. var options = {
  17. options: {
  18. debug: true
  19. },
  20. connection: {
  21. cluster: "aws",
  22. reconnect: true
  23. },
  24. identity: {
  25. username: "none",
  26. password: "nono"
  27. },
  28. channels: ["happinessltd"]
  29. };
  30.  
  31. var client = new tmi.client(options);
  32. client.connect();
  33.  
  34.  
  35. var sayPharseTimer;
  36. client.on('connected', function (address, port) {
  37. console.log("Address: " + address + " Port: " + port);
  38. sayPharseTimer = setInterval(sayPhrase, timeout);
  39. });
  40.  
  41. client.on("disconnected", function (reason) {
  42. if (sayPharseTimer) {
  43. clearInterval(sayPharseTimer);
  44. }
  45. }
  46. );
  47. function sayPhrase() {
  48. client.say("happinessltd", phrases[Math.floor(Math.random() * phrases.length)]);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement