Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. var tmi = require('tmi.js');
  2. var channelname = "HappyOtterArt"
  3. var options = {
  4. options: {
  5. debug: true
  6. },
  7. connection: {
  8. cluster= "aws",
  9. reconnect: true
  10. },
  11. identity:{
  12. username: "BOT ACCOUNT NAME",
  13. password: "OAUTH KEY " //link provided
  14. },
  15. channels:[channelname]
  16.  
  17.  
  18.  
  19. }
  20.  
  21. car 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", funtion(channel, user, message,self){
  31. if (self) return;
  32. var words = message.split(" ");
  33. var command = words[0];
  34. var response;
  35. if (command === '!spooked'){
  36. if (words.length < 3 && words.length > 1){
  37. var chance = Math.random();
  38. if (chance > 0.5) response = user + " has spooked " + words[1]
  39. if (chance =< 0.5) response = user + " has failed to spook " + words[1]
  40. }
  41. }
  42.  
  43.  
  44. client.action(channelname, response);
  45. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement