Advertisement
Guest User

Untitled

a guest
Oct 27th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. var tmi = require ('tmi.js');
  2.  
  3. var options = {
  4. options: {
  5. debug: true
  6. },
  7. connection: {
  8. cluster: "aws",
  9. reconnect: true
  10. },
  11. identity: {
  12. username: "enoladesert",
  13. password: "oauth:oathcode987654321"
  14. },
  15. channels: ["enoladesert"]
  16. };
  17.  
  18. var client = new tmi.client(options);
  19. client.connect();
  20.  
  21. client.on("subscription", function (channel, username) {
  22. switch (channel) {
  23. case '#enoladesert':
  24. client.action(channel, "imGlitch <3 Welcome " + username + " to the Enolaroos! <3 imGlitch");
  25. break;
  26. }
  27. });
  28.  
  29. client.on("resub", function (channel, username, months, message) {
  30. switch (channel) {
  31. case '#enoladesert':
  32. client.action(channel, "imGlitch <3 Welcome back " + username + " to the Enolaroos! <3 imGlitch");
  33. break;
  34. }
  35. });
  36.  
  37. client.on("cheer", function (channel, userstate, message) {
  38. var twitchname = userstate['display-name'];
  39. if (userstate['display-name'] == null) {
  40. var twitchname = userstate.username;
  41. }
  42. switch (channel) {
  43. case '#enoladesert':
  44. client.say(channel, "TwitchRPG Thanks for the " + userstate.bits + " bits, " + twitchname + "!");
  45. break;
  46. }
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement