Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. var tmi = require('tmi.js');
  2. var channelname = "MrJunior717"
  3. var options = {
  4. options: {
  5. debug: true
  6. },
  7. connection: {
  8. "cluster": "aws",
  9. "reconnect": true
  10. },
  11. identity:{
  12. username: "BOTNAME",
  13. password: "OATHTOKEN"
  14. },
  15. channels:[channelname]
  16.  
  17.  
  18.  
  19. }
  20.  
  21. var client = tmi.client(options);
  22. client.connect();
  23.  
  24. client.on("connected",function(address,port){
  25. console.log("connected: " + address + ":" + port);
  26. client.action(channelname,"I am Live");
  27.  
  28. })
  29.  
  30. client.on("chat", function(channel, user, message,self){
  31. var words = message.split(" ");
  32. var command = words[0];
  33. var response ="";
  34. if (command === '!spook'){
  35. if (words.length < 3 && words.length > 1){
  36. if (Math.random() > 0.5) response = user.username + " has spooked " + words[1]
  37. if (Math.random() <= 0.5) response = user.username + " has failed to spook " + words[1]
  38. }
  39. client.action(channelname, response);
  40. }
  41.  
  42.  
  43.  
  44. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement