Guest User

fbwitherbot.js

a guest
Apr 5th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let rpoints = 0;
  2. var chelikiSDostupov= ['fbwithher', 'cuprousds', 'zitgard', 'abysshole', 'dimaximuss', 'criteveryhit', 'artokrr_', 'chiakiminami', 'minecraft_on_xbox360', 'miss__witch', 'gromofananis', 'rekvizit8bit', 'scherdokborsh'];
  3. var zdorovalsa = [];
  4. var coolGuys= ['fbwithher', 'zitgard', 'rekvibot', 'criteveryhit',];
  5. const tmi = require('tmi.js');
  6. let cdhf4 = ''
  7. let cdhf3 = ''
  8. let cdhf5 = ''
  9. let points = 0;
  10. let vmxj = 0;  
  11.  
  12. const opts = {
  13.   identity: {
  14.     username: "fbwitherbot",
  15.     password: "pblfueqnspu9cagnh7ik77axgrfdut"
  16.   },
  17.   channels: [
  18.     "rekvizit8bit"
  19.   ]
  20. };
  21.     let num2 = dice(2);
  22.  
  23.     let cdhf2 = '';
  24.     if (num2 == 1) cdhf2 = `FeelsGoodMan`;
  25.       else if (num2 ==2) cdhf2 = `peepoHappy`;  
  26.  
  27. const client = new tmi.client(opts);
  28.  
  29.  
  30. client.on('message', onMessageHandler);
  31. client.on('connected', onConnectedHandler);
  32.  
  33.  
  34. client.connect();
  35.  
  36.  
  37. function onMessageHandler (target, context, msg, self) {
  38.   if (self) { return; }
  39.  
  40.  
  41.   const commandName = msg.trim();
  42.  
  43.  
  44.   if (commandName === '!nam' &&  chelikiSDostupov.includes(context['username'])) {
  45.     client.say(target, 'NaM') }
  46.   if (commandName === '!sleeper' && coolGuys.includes(context['username'])) {
  47.     client.say(target, 'ResidentSleeper') }
  48.   if (commandName === '!roll') {
  49.         let num = dice(20);
  50.     let cdhf = '';
  51.     if (num < 10)  cdhf = "Это не очень много. Попробуй снова! FeelsBadMan";
  52.     if (num == 10) cdhf = "Это довольно много! FeelsOkayMan";
  53.     if (num > 10) cdhf = "Это очень много! Поздравляю! EZ";
  54.     if (num == 20) cdhf = "Жесть! PagChomp PagChomp PagChomp PagChomp";
  55.     client.say(target, '@'+context['username'] + ` Подбросил правильный икосаэдр и получил ${num}! ${cdhf}`); }
  56.   if (commandName === '!uppercase' && chelikiSDostupov.includes(context['username'])) {
  57.     const text = generate_random_string_uppercase(15);
  58.     let num2 = dice(2);
  59.     let cdhf2 = '';
  60.     if (num2 == 1) cdhf2 = `FeelsGoodMan`;
  61.       else if (num2 == 2) cdhf2 = `peepoHappy`;
  62.     client.say(target,  '@'+context['username'] + ` Ты получил ${text}! ${cdhf2}`) }
  63.   if (commandName === '!lowercase' && chelikiSDostupov.includes(context['username'])) {
  64.     const text = generate_random_string_lowercase(15)
  65.     let cdhf2 = '';
  66.     if (num2 == 1) cdhf2 = `FeelsGoodMan`;
  67.       else if (num2 ==2) cdhf2 = `peepoHappy`;
  68.     client.say(target, '@'+context['username'] + ` Ты получил ${text}! ${cdhf2}`) }
  69.   if (commandName === '!generate' && chelikiSDostupov.includes(context['username'])) {
  70.     const text = generate_random_string(10);
  71.     let num2 = dice(2);
  72.     client.say(target, '@'+context['username'] ` Ты получил ${text}! ${cdhf2}`) }
  73.   if (commandName.includes('👇') ||commandName.includes(':point_down:') && chelikiSDostupov.includes(context['username']))    {
  74.     let point_down = /👇/gi;
  75.     let get_back = commandName.replace(point_down, ' :point_up:');
  76.     get_back = get_back.replace('бот', 'человек');
  77.     get_back = get_back.replace('l', '|');
  78.     get_back = get_back.replace('|', 'l');
  79.     get_back = get_back.replace('да?', 'нет');
  80.     get_back = get_back.replace('он', 'нет, я')
  81.     get_back = get_back.replace('хейтер', 'не хейтер')
  82.     get_back = get_back.replace('внизу', 'вверху')
  83.     get_back = get_back.replace('OwO', 'UwU')  
  84.     get_back = get_back.replace('nigger', 'HYPERBRUH') 
  85.     get_back = get_back.replace('niga', 'HYPERBRUH')
  86.     get_back = get_back.replace('niger', 'HYPERBRUH')
  87.     get_back = get_back.replace('nigga', 'HYPERBRUH')
  88.     get_back = get_back.replace('ниггер', 'HYPERBRUH')
  89.     get_back = get_back.replace('нигер', 'HYPERBRUH')
  90.     get_back = get_back.replace('нига', 'HYPERBRUH')
  91.     get_back = get_back.replace('нигга', 'HYPERBRUH')
  92.     client.say(target, get_back);    
  93.   }
  94.   if (commandName.includes('ДБД') && coolGuys.includes(context['username'])) {
  95.   client.say(target, '@'+context['username']+ ` СЛАВА ДБД!`) }
  96.   if (commandName.includes('OwO')) {
  97.   client.say (target, '@'+context['username'] + ` UwU 👍`)}
  98.     if (!zdorovalsa.includes(context['username']) && coolGuys.includes(context['username'] || context['mod'])){
  99.     let num3 = dice(4);
  100.     if (num3 == 1) cdhf3 = 'KonCha';
  101.     if (num3 == 2) cdhf3 = 'rekviHello';
  102.     if (num3 == 3) cdhf3 = 'pajaHey';
  103.     if (num3 == 4) cdhf3 = 'pajaMLADA';
  104.     let num4 = dice(8);
  105.     if (num4 == 1) cdhf4 = 'Прив!';
  106.     if (num4 == 2) cdhf4 = 'Привет!';
  107.     if (num4 == 3) cdhf4 = 'Конничива! AYAYA';
  108.     if (num4 == 4) cdhf4 = 'Здарова!';
  109.     if (num4 == 5) cdhf4 = 'Прив!';
  110.     if (num4 == 6) cdhf4 = 'Приветствую.';
  111.     if (num4 == 7) cdhf4 = 'Здравствуйте.';
  112.     if (num4 == 8) cdhf4 = 'Прифки!';
  113.     zdorovalsa.push(context['username'])
  114.     client.say(target,  '@'+context['username']+ ` ${cdhf4} ${cdhf3}`);
  115.      }
  116.   if (commandName === '!points') {
  117.     client.say(target,  '!rpoints');
  118.     sleep(2000).then(() => {
  119.       client.say(target, '!give fbwithher '+(parseInt(rpoints, 10)-1));
  120.     })
  121.   }
  122.   if (commandName.includes('rPoints : У fbwitherbot')) {
  123.   rpoints = commandName.match(/\d+/g).map(Number); }
  124.   if (commandName.includes('FeelsWeirdMan') && chelikiSDostupov.includes(context['username'])) {
  125.   client.say(target, '@'+context['username']+` FeelsWeirdMan`) }
  126.   if (commandName === '!sleep') {
  127.   client.say(target, 'ResidentSleeper') }
  128.   if (commandName.includes('ResidentSleeper')) {
  129.       client.say(target, '/timeout '+context['username']+ ' 600')
  130. }
  131.     console.log(context['username']+ ':'+ ` ${commandName}`);
  132. }
  133.  
  134.  
  135. function dice (sideNumber) {
  136.   const sides= sideNumber;
  137.   return Math.floor(Math.random() * sides) + 1;
  138. }
  139.  
  140. function generate_random_string_uppercase(string_length){
  141. let random_string = '';
  142.     let random_ascii;
  143.     let ascii_low = 65;
  144.     let ascii_high = 90
  145.     for(let i = 0; i < string_length; i++) {
  146.         random_ascii = Math.floor((Math.random() * (ascii_high - ascii_low)) + ascii_low);
  147.         random_string += String.fromCharCode(random_ascii)
  148.     }
  149.     return random_string
  150. }
  151.  
  152. function generate_random_string_lowercase(string_length){
  153.     let random_string = '';
  154.     let random_ascii;
  155.     for(let i = 0; i < string_length; i++) {
  156.         random_ascii = Math.floor((Math.random() * 25) + 97);
  157.         random_string += String.fromCharCode(random_ascii)
  158.       }
  159.     return random_string
  160. }
  161.  
  162. function generate_random_string(string_length){
  163.     let random_string = '';
  164.     let random_ascii;
  165.     let ascii_low = 65;
  166.     let ascii_high = 90
  167.     for(let i = 0; i < string_length; i++) {
  168.         random_ascii = Math.floor((Math.random() * (ascii_high - ascii_low)) + ascii_low);
  169.         random_string += String.fromCharCode(random_ascii)
  170.     }
  171.     return random_string
  172. }
  173.  
  174. function generate_random_number(){
  175.     let num_low = 1;
  176.     let num_high = 9;
  177.     return Math.floor((Math.random() * (num_high - num_low)) + num_low);
  178. }
  179.  
  180. function generate() {
  181.     return generate_random_string(3) + generate_random_number()
  182. }
  183.  
  184. function onConnectedHandler (addr, port) {
  185.   console.log(`* Connected to ${addr}:${port}`);
  186. }
  187. const sleep = (milliseconds) => {
  188.     return new Promise(resolve => setTimeout(resolve, milliseconds))
  189.   }
Add Comment
Please, Sign In to add comment