Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var tmi = require('tmi.js');
  2.  
  3.  
  4.  
  5.     var options = {
  6.         options: {
  7.             debug: true
  8.         },
  9.         connection: {
  10.             reconnect: true
  11.         },
  12.     identity: {
  13.         username: "ChatControler",
  14.         password: "oauth:gbt65e6vfz7czsdy59064qfzblr7dz"
  15.     },
  16.     channels: ["majkkyna"]
  17. };
  18.  
  19.  
  20. var client = new tmi.client(options);
  21. client.connect();
  22.  
  23. client.on('chat', function (channel, user, message, self) {
  24.  
  25.     if(message == "!bot"){
  26.         client.say(channel,"Ano. Bot jsem ja :P :D ! Autor: Nicprohubeny(MrPearmen)");
  27.     }else if(message == "!csrank"){
  28.         client.say(channel,"MakkyRank: Silver 4")
  29.     }else if(message == "!majkkyna"){
  30.         client.say(channel,""+user.username+" si mysli, ze majkkyna je nej! <3 <3");
  31.     }else if(message == "!Majkkyna"){
  32.         client.say(channel,""+user.username+" si mysli, ze majkkyna je nej! <3 <3");
  33.     }else if(message.startsWith("ahoj")||message.startsWith("Ahoj")){
  34.  
  35.         if(!user.username == "ChatControler"){
  36.             client.say(channel, "Ahoj @"+user.username+" HeyGuys ;)");
  37.         }
  38.     }else if(message == "!test"){
  39.         client.say(channel,"Ale funguje <3")
  40.  }
  41.  
  42. });
  43. client.on("clearchat", function (channel) {
  44.     client.action(channel,"Chat byl vymazan moderatorem!");
  45.     client.say(channel,"1. Kappa :D")
  46. });
  47.  
  48. client.on("ban", function (channel, username, reason) {
  49.  
  50.     if(reason != null){
  51.     client.action(channel,"Uzivatel "+username+" byl zabanovan! Duvod: "+reason);
  52.     }else{
  53.         client.action(channel,"Uzivatel "+username+" byl zabanovan!");
  54.     }
  55.  
  56. });
  57. client.on("action", function (channel, userstate, message, self) {
  58.     // Don't listen to my own messages..
  59.     if (self) return;
  60.  
  61.     if(message == "gives ChatControler a hug!"){
  62.         if(userstate.username == "makkybot"){
  63.             client.say(channel,"Take vas vsechny obejmu ;) Keepo :D <3");
  64.         }
  65.     }else{
  66.  
  67.     }
  68. });
  69.  
  70. client.on("timeout", function (channel, username, reason, duration) {
  71.     if(reason != null){
  72.     client.action(channel,username+" byl docasne zabanovan na "+duration+" sekund za: "+reason);
  73.     client.whisper(username,"Byl jsi docasne zabanovan na "+duration+" sekund za: "+reason);
  74.     }else{
  75.         client.action(channel,username+" byl docasne zabanovan na "+duration+" sekund.");
  76.         client.whisper(username,"Byl jsi docasne zabanovan na "+duration+" sekund.");
  77.     }
  78. });
  79.  
  80. client.on('connected', function(adress,port) {
  81.     console.log("ChatControler by nicprohubeny byl uspesne nacten!");
  82.     console.log("pripojeno: "+adress+":"+port);
  83. })
  84. client.on("join", function (channel, username, self) {
  85.     if(username != "chatcontroler"){
  86.         console.log("Vitej "+username+ " na streamu!");
  87.     }else console.log(channel,"Byl jsem spusten!");
  88.  
  89.  
  90. });
  91.  
  92. client.on("subscription", function (channel, username, method, message, userstate) {
  93.     client.acion(channel,username+" dal subscribe! DEKUJEME!");
  94. });
  95.  
  96. client.on("cheer", function (channel, userstate, message) {
  97.     client.say(channel,":o :o OMG! "+userstate.username+" poslal cheer! ;) Zprava: "+message);
  98. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement