Advertisement
Guest User

Untitled

a guest
Jul 9th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. const TwitchJS = require('twitch-js');
  2. //Install node and https://www.npmjs.com/package/twitch-js
  3.  
  4. // Setup the client with your configuration; more details here:
  5. // https://github.com/twitch-apis/twitch-js/blob/master/docs/Chat/Configuration.md
  6. const options = {
  7. channels: ["#moonmoon_ow"],
  8. identity: {
  9. username: "FriendlyBaron",
  10. password: "oauth:changeMe"
  11. },
  12. clientId: "changeMe"
  13. };
  14.  
  15. const client = new TwitchJS.client(options);
  16.  
  17. var lastMsg = 0
  18. var lastMsgText = ""
  19.  
  20.  
  21. client.on('chat', (channel, userstate, message, self) => {
  22. //console.log(`Message "${message}" received from ${userstate['display-name']} in ${channel}`);
  23. if (self) return;
  24.  
  25. var emotes = ["moon21", "moon22", "moon23", "moon24", "moon2A", "moon2BANNED", "moon2C", "moon2CD", "moon2COFFEE", "moon2CREEP", "moon2CUTE", "moon2D", "moon2DUMB", "moon2E", "moon2EZ", "moon2FEELS", "moon2GASM", "moon2GOOD", "moon2GUMS", "moon2H", "moon2HEY", "moon2KISSES", "moon2L", "moon2LUL", "moon2M", "moon2MD", "moon2MLADY", "moon2MLEM", "moon2MM", "moon2N", "moon2NOM", "moon2O", "moon2OWO", "moon2P", "moon2PLSNO", "moon2S", "moon2SHRUG", "moon2SMAG", "moon2SMUG", "moon2SPY", "moon2T", "moon2TEEHEE", "moon2W", "moon2WAH", "moon2WINKY", "moon2WOW", "moon2XD", "moon2YE"]
  26. /*if(userstate['display-name'].toLowerCase() == "plead" && Date.now()-3000 > lastMsg)
  27. {
  28. console.log(lastMsg + " plead attempting from " + userstate['display-name'])
  29. client.say(channel, userstate['display-name'] + " " + emotes[Math.floor(Math.random()*emotes.length)])
  30. lastMsg = Date.now()
  31. lastMsgText = userstate['display-name'] + " ppHop"
  32. }*/
  33. });
  34.  
  35. client.on('connected', function(address, port) {
  36. console.log(">Connected<")
  37. });
  38.  
  39.  
  40. client.on('resub', function(channel, username, months, message, userstate, methods) {
  41. //console.log("resub")
  42. //client.say(channel, "moon2A Thanks for givin your lunch money for " + months + " months, " + username + " moon2A");
  43. });
  44.  
  45.  
  46. client.on('subscription', function(channel, username, method, message, userstate) {
  47. //console.log("normalsub")
  48. //client.say(channel, "moon2A Thanks for givin your lunch money, " + username + " moon2A");
  49. });
  50.  
  51. client.on('subgift', function(channel, username, recipient, method, userstate) {
  52. //console.log("giftsub")
  53. //client.say(channel, "moon2A " + recipient + ", you will take this sub from " + username + " and you will like it moon2A");
  54. });
  55.  
  56. client.connect();
  57.  
  58.  
  59. /*
  60. { badges: { subscriber: '0', bits: '1' },
  61. color: '#FF69B4',
  62. 'display-name': 'souljahboy',
  63. emotes: null,
  64. id: '868b4e34-cde6-4027-b522-6aca1e72fdd0',
  65. mod: false,
  66. 'room-id': '121059319',
  67. subscriber: true,
  68. 'tmi-sent-ts': '1530599857554',
  69. turbo: false,
  70. 'user-id': '172853390',
  71. 'user-type': null,
  72. 'emotes-raw': null,
  73. 'badges-raw': 'subscriber/0,bits/1',
  74. username: 'souljahboy',
  75. 'message-type': 'chat' }
  76. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement