├── .gitignore ├── package.json ├── bot.js ├── parse.js └── ids.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | stickers 3 | video_files 4 | result.json 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jabrach", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "parse.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "parse": "node parse", 9 | "start": "node bot" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "telegraf": "^4.16.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /bot.js: -------------------------------------------------------------------------------- 1 | const { Telegraf } = require('telegraf') 2 | const ids = require('./ids.json') 3 | 4 | const bot = new Telegraf(process.env.BOT_TOKEN) 5 | 6 | bot.command('lol', async (ctx) => { 7 | const index = Math.floor(Math.random() * ids.length) 8 | ctx.reply(`https://t.me/c/1577490870/${ids[index]}`) 9 | }) 10 | 11 | bot.launch() 12 | process.once('SIGINT', () => bot.stop('SIGINT')) 13 | process.once('SIGTERM', () => bot.stop('SIGTERM')) 14 | 15 | console.log('Bot launched', new Date()) 16 | -------------------------------------------------------------------------------- /parse.js: -------------------------------------------------------------------------------- 1 | const readline = require('readline') 2 | const fs = require('fs') 3 | 4 | const find = ['ле', 'le', 'лел', 'lel', 'лол', 'lol', 'кек', 'kek', 'лек', 'lek', 'kjk'] 5 | 6 | const ids = [] 7 | let lastid = null 8 | 9 | const lineReader = readline.createInterface({ 10 | input: fs.createReadStream('result.json') 11 | }) 12 | 13 | lineReader.on('line', async function (rawLine) { 14 | const line = rawLine.trim().toLocaleLowerCase() 15 | 16 | if (line.indexOf('"id"') === 0) { 17 | const id = line.replace(/[^\d]+/g, '') 18 | 19 | if (id) { 20 | lastid = parseInt(id) 21 | } 22 | } else if (lastid && line.indexOf('"text"') === 0) { 23 | const text = line.replace(/^"text": "/, '').replace(/",$/, '') 24 | 25 | if (find.indexOf(text) > -1) { 26 | ids.push(lastid) 27 | lastid = null 28 | } 29 | } 30 | }); 31 | 32 | lineReader.on('close', async function () { 33 | console.log('Found:', ids.length) 34 | fs.writeFileSync('ids.json', JSON.stringify(ids), { encoding: 'UTF8' }) 35 | console.log('End.') 36 | }) 37 | -------------------------------------------------------------------------------- /ids.json: -------------------------------------------------------------------------------- 1 | [82,106,259,740,742,761,1122,1218,1274,1568,1576,1596,2108,2710,2767,2990,3034,3282,3327,3408,3434,3474,3616,3641,3651,3676,3867,3976,4009,4010,4019,4163,4185,4268,4287,4498,4587,4676,4783,4878,4891,4902,5360,5364,5473,5741,5807,5840,5868,5882,6033,6054,6191,6296,6795,6840,6873,6899,6989,7022,7031,7045,7057,7257,7266,7340,7416,8503,8897,9063,9121,9133,9519,9580,9586,10013,10092,10176,10220,10239,10555,10653,11088,11248,11356,11542,11682,12323,12340,12384,12395,12434,12444,12534,12616,12702,12732,13097,13112,13135,13173,13218,13230,13424,13455,13578,13641,13642,13778,13901,13910,14036,14132,14241,14317,14373,14495,14537,14865,14867,14874,15197,15357,15375,15398,15447,15519,15530,15675,15805,16053,16216,16230,16269,16400,16598,16636,16646,16715,16749,16760,16793,16794,16801,16878,16901,16915,17060,17170,17310,17404,17414,17427,17770,17864,17917,18011,18018,18019,18087,18241,18273,18457,18483,18539,18586,18665,18818,18868,18905,18919,19087,19105,19234,19269,19577,19613,19745,19759,19769,19779,19894,19994,20026,20063,20167,20192,20194,20200,20287,20396,20456,20480,20512,20521,20572,20637,21107,21151,21186,21284,21547,21569,21674,21730,21731,21846,21849,21907,21971,22030,22035,22049,22089,22181,22231,22266,22289,22381,22388,22612,22627,22993,23043,23181,23288,23413,23558,23590,23937,23959,24188,24286,24543,24551,24558,24559,24671,24733,24837,25037,25512,25715,25716,25806,25833,25962,26021,26022,26049,26145,26230,26254,26316,26334,26337,26480,26591,26713,26719,26788,26802,26900,27027,27161,27171,27273,27585,27589,27693,27795,28061,28071,28183,28443,28680,28683,28730,28826,28881,29072,29124,29171,29258,29260,29331,29410,29539,29904,29922,30116,30274,30319,30332,30579,30606,30803,31031,31096,31179,31312,31360,31366,31450,31468,31573,31574,31751,31758,32142,32364,32471,32479,32526,32936,33154,33170,33852,34049,34051,34081,34082,34191,34204,34357,34444,34456,34475,34608,35051,35073,35306,35310,35412,35487,35692,35704,35720,35779,35781,35935,35936,36221,36391,36397,36547,36604,36802,36805,36808,36866,36885,37043,37234,37425,37506,37703,37706,37762,38070,38186,38343,38488,38525,38546,38565,38576,39020,39023,39112,39690,39931,39940,40113,40182,40326,41200,41206,41283,41416,41417,41418,41779,41872,42014,42082,42090,42096,42266,42319,42547,42722,42743,43227,43474,43726,44166,44617,44912,45200,45541,45826,45849,45923,46067,46161,46162,46298,46306,46374,46466,46653,46697,46701,46808,47119,47122,47381,47950,48222,48474,48546,48954,49082,49083,49224,49273,49421,49588,49592,49957,50194,50227,50256,50347,50428,50436,50763,50813,50895,51030,51404,51424,51621,51997,52060,52352,52371,52789,52837,52898,53043,53703,53736,53753,54167,54229,54342,54440,54441,54453,54509,54618,54831,54833,54857,54900,54934,55044,55081,55105,55208,55210,55290,55315,55623,55646,55648,55650,55703,55739,55896,55897,55914,56143,56486,56516,56603,57150,57720,57730,58308,58582,58592,58605,58846,59078,59101,59428,59587,59809,60339,60572,60674,60690,61020,61032,61131,61185,61378,61453,61487,61621,62091,62264,62696,62733,62752,63032,63146,63395,63717,64356,64560,65635,65693,65755,65768,65779,66226,66554,66590,66594,66624,66888,67607,67900,68162,68167,68280,68626,68795,69596,69671,69911,69948,70486,70609,70780,71241,71343,71408,71457,71766,71805,71807,71857,71911,71985,72075,72249,72540,72553,72605,72697,72698,72721,72736,72802,73079,73413,73416,73477,73483,73779,74074,74115,74134,74139,74180,74498,74542,74543,74550,74553,74953,75066,75209,75287,75572,75578,75676,75775,75999,76261,76470,76578,76698,76910,76911,77040,77377,77391,78371,78428,78976,79031,79283,79463,79466,79496,80044,80573,81009,81124,81756,81912,82284,82306,82309,82319,82591,82906,83074,83104,83240,83241,83242,83243,83244,83437,83744,83749,83754,83867,83894,84896,84910,84914,84916,85049,85439,85470,85791,86117,86800,86806,87009,87191,87296,87397,87487,87493,87666,87671,87907,87924,87928,88351,88736,89022,89311,89317,89354,89550,89555,89655,89666,89667,89671,89706,89783,90428,90579,90583,90655,90866,90900,90969,91067,91132,91156,91284,91297,91300,91318,91319,91403,91406,91432,91445,91492,91533,91779,92308,92348,92354,92364,92404,92406,92646,92786,92882,93475,93521,93557,93631,93634,94176,94371,94473,94606,94988,95008,95010,95060,95275,95584,95620,95658,95987,96668,96959,96960,96998,97002,97008,97368,97605,97623,97902,97989,98030,98597,98644,98648,99016,99049,99070,99093,99101,99103,99107,99115,99138,99163,99217,99372,99729,99986,100015,100062,100175,100573,100584,100616,100653,100665,101123,101148,101149,101211,101291,101637,101841,102068,102078,102092,102110,102157,102340,102392,102447,102645,102791,102936,103177,103277,103414,103547,103561,103604,103628,103799,103952,103960,104011,104092,104289,104293,104614,104622,104892,104894,104923,104966,104968,105040,105098,105295,105386,105388,105393,105529,105551,105567,105589,105710,105842,105854,105897,106096,106097,106098,106183,106266,106267,106268,106269,106270,106453,106458,106461,106557,106687,107275,107374,107413,107582,107902,108367,108478,108531,108781,108810,108816,108929,108937,108948,108957,109192,109537,109582,110245,110472,111018,111046,111079,111082,111086,111097,111274,111513,111538,111594,111601,111603,111676,111709,111920,112109,112191,112294,112295,112297,112364,112396,112434,112531,112662,112783,112788,112846,112977,112979,113140,113177,113264,113303,113362,113389,113473,113485,113489,113514,113573,113923,113936,113948,114043,114222,114233,114299,114570,115224,115529,115554,115729,115791,115875,116224,116312,116472,116514,117120,117123,117130,117135,117158,117186,117341,117403,117533,117541,117741,117868,117892,118065,118066,118067,118141,118144,118168,118173,118187,118463,118585,118808,119028,119031,119041,119045,119102,119119,119165,119193,119480,119508,119676,119714,119936,120041,120338,120469,120674,120677,120809,120824,120825,121109,121305,121355,121406,121431,121610,121655,121656,121840,122044,122578,122679,123002,123366,123568,123639,124287,124304,124409,124529,124535,124546,124601,124648,124697,124704,124785,124808,124851,124997,125253,125339,125479,125578,125585,125643,125768,125875,126092,126140,126198,126304,126347,126391,126536,126813,126947,127154,127173,127221,127706,127775,127777,128269,128699,128817,128973,128998,129002,129263,129722,129766,130020,130027,130095,130152,130205,130258,130307,131029,131266,131268,131419,131420,131590,132117,132343,132469,132737,132896,133026,133029,133112,133369,133379,133570,133735,133930,134004,134162,134361,134640,134672,134858,135101,135289,135397,135417,135719,136007,136039,136161,136298,136308,136360,136368,136456,136607,136725,137050,137146,137509,137563,137594,137728,138175,138519,138742,138866,138900,138968,139152,139236,139279,139540,140138,140254,140591,140600,140657,140702,140736,141081,141112,141583,141589,141756,142133,142453,142547,142800,142817,142963,143134,143393,143704,143763,143957,143996,144001,144126,144154,144249,144354,144546,144548,144581,144701,144737,144818,144970,144972,145011,145220,145278,145764,145765,146191,146207,146221,146392,146399,146409,146442,146729,146781,146826,146872,146888,147018,147020,147099,147449,147452,147469,147478,147507,147618,148055,148127,148397,148461,148471,148472,148474,148573,148707,148708,148797,148835,149230,149380,149703,149780,149942,150113,150117,150664,150709,150781,151151,151207,151288,151364,151687,151698,151803,151918,151958,152339,152341,152344,152530,152948,153150,153287,153316,153325,153353,153504,153808,153983,154450,154616,154700,154903,154909,155033,155037,155173,155198,155203,155320,155378,155415,155487,155547,155850,155856,155943,155962,156006,156077,156173,156221,156223,156337,156442,156443,156456,156471,156552,156626,156794,156857,157059,157070,157163,157210,157213,157316,157347,157422,157424,157434,157695,157708,157730,158024,158031,158167,158374,158538,158539,158696,158714,158908,159075,159146,159295,159318,159503,159537,159626,159661,159756,159757,159758,159770,159810,159871,159884,159994,160048,160207,160248,160370,160379,160406,160442,160446,160542,160543,160694,160954,161025,161043,161047,161265,161305,161337,161404,161406,161408,161425,161528,161536,161675,161690,161752,161785,161799,161804,162043,162062,162289,162293,162327,162458,162460,162461,162593,162681,162932,162980,162981,163002,163049,163174,163428,163465,163613,163703,163719,163911,163952,164088,164095,164115,164257,164413,164775,164782,164892,164893,164984,165037,165236,165237,165281,165356,165384,165630,165653,165768,165926,166279,166280,166297,166302,166303,166339,166416,166420,166543,166589,167030,167057,167069,167175,167382,167419,167525,167526,167536,167624,167695,167865,167990,168027,168117,168213,168422,168531,168616,168625,168674,168689,168768,168769,169158,169159,169162,169413,169430,169440,170045,170240,171091,171092,171335,171342,171365,171411,171424,171435,171501,171834,171836,171851,171929,172298,172383,172432,172468,172553,172564,172580,172702,172741,172908,173099,173100,173130,173363,173423,173460,173668,173671,173766,173874,173898,174098,174120,174195,174349,174359,174361,174419,174421,174423,174449,174450,174454,174469,174565,174743,174764,174861,174895,174933,174938,174946,174956,174967,174971,175076,175093,175112,175124,175127,175148,175173,175176,175179,175214,175257,175386,175387,175542,175659,175714,175727,175754,175779,175846,175857,175866,175890,175897,176220,176291,176409,176505,176698,176708,176761,177122,177158,177179,177603,177623,177624,177678,177720,178021,178150,178342,178377,178421,178630,178684,178815,178834,179058,179193,179285,179670,179741,179743,179817,179821,179865,179877,179982,179984,179995,180001,180003,180030,180044,180048,180109,180120,180130,180161,180348,180451,180456,180457,180578,180618,180876,180977,181033,181080,181245,181246,181320,181321,181325,181394,181398,181404,181410,181441,181503,181510,181571,181572,181611,181748,181751,181752,181879,182103,182173,182174,182177,182180,182185,182193,182201,182202,182203,182266,182270,182288,182353,182381,182404,182420,182483,182583,182647,182705,182757,182874,183042,183078,183104,183109,183159,183289,183307,183411,183456,183565,183589,183670,183673,183725,183728,183729,183732,183734,183739,183746,183757,183761,183764,183768,183770,183773,183776,183790,183816,183887,183888,183903,183907,183910,183915,183916,183926,183927,183930,183936,183941] --------------------------------------------------------------------------------