Advertisement
Guest User

Untitled

a guest
Feb 6th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var tmi = require('tmi.js');
  2. var _ = require('underscore');
  3. var oauth = require('./oauth.js');
  4. var req = require('ajax-request');
  5. var sleep = require('sleep');
  6.  
  7. var options = {
  8.   options: {
  9.     debug: true
  10.   },
  11.   connection: {
  12.     cluster: "aws",
  13.     reconnect: true,
  14.     secure: true
  15.   },
  16.   identity: {
  17.     username: "fairubot",
  18.     password: oauth.passwdbot
  19.   },
  20.   channels: ["teamfortresstv"]
  21. };
  22.  
  23. var client = new tmi.client(options);
  24. client.connect();
  25.  
  26. function randomA(max) {
  27.   return Math.floor(Math.random() * max);
  28. }
  29.  
  30. client.on("timeout", function(channel, username, reason, duration){
  31.   switch(randomA(6)){
  32.     case 1:
  33.       client.say(channel,"lol see ya " + username);
  34.       break;
  35.     case 2:
  36.       client.say(channel,"whoa watch your language " + username);
  37.       break;
  38.     case 3:
  39.       client.say(channel,"byebye " + username);
  40.       break;
  41.     case 4:
  42.       client.say(channel,"cu in " +duration+"sek " + username);
  43.       break;
  44.     case 5:
  45.       client.say(channel,"xd "+username+" nice job...");
  46.       break;
  47.     case 6:
  48.       client.say(channel, "SMOrc has spoken to you "+username);
  49.       break;
  50.   }
  51.   sleep.sleep(5);
  52. });
  53.  
  54. client.on("ban", function(channel, username, reason){
  55.   switch(randomA(4)){
  56.     case 1:
  57.       client.say(channel,"lol see ya " + username);
  58.       break;
  59.     case 2:
  60.       client.say(channel,"whoa get banned " + username);
  61.       break;
  62.     case 3:
  63.       client.say(channel,"bb " + username);
  64.       break;
  65.     case 4:
  66.       client.say(channel,"see the SMOrc hammer "+username);
  67.       break;
  68.   }
  69.   sleep.sleep(5);
  70. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement