Skip to content

Instantly share code, notes, and snippets.

View ejnshtein's full-sized avatar
🦍
Oug Developer

岡部 倫太郎 ejnshtein

🦍
Oug Developer
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ejnshtein on github.
  • I am ejnshtein (https://keybase.io/ejnshtein) on keybase.
  • I have a public key whose fingerprint is F3D8 50FE 1A54 21A1 4EA4 1678 6B96 0FF3 DFAD 4D6B

To claim this, I am signing this object:

const puppeteer = require('puppeteer');
const fs = require('fs');
const os = require('os');
var anime = {};
async function run(searched) {
searched = searched.replace(';',' ');
// Setup pupeteer
const browser = await puppeteer.launch({
headless: false,
});
const Telegraf = require('telegraf')
const bot = new Telegraf(config.bot.token)
function sleep(timeout) {
return new Promise(resolve => setTimeout(resolve, timeout))
}
bot.command('debil', async ctx => {
await sleep(5000)
await ctx.reply('ok')
@ejnshtein
ejnshtein / tbot.js
Last active September 27, 2018 19:38
bot.start((ctx) => {
if (ctx.chat.id == config.adminID) {
} else
ctx.reply('Привет! Проголодался? У нас есть чем накормить тебя!', makeKeyboard(['📖 Меню', '🛒 Корзина', '📍 Все рестораны']))
})
cosnt makeKeyboard = buttons => {
const keyboard = []
let line = []
buttons.forEach(button => {
const crypto = require('crypto')
const decrypt = (text, secret, algorithm = 'aes256') => {
const decipher = crypto.createDecipher(algorithm, secret)
let decrypted = decipher.update(text, 'hex', 'utf8')
decrypted += decipher.final('utf8')
return decrypted
}
///////////////////
// const crypto = require('crypto')
const encrypt = (text, secret, algorithm = 'aes256') => {
const Telegraf = require('./telegraf')
const { bottoken } = require('./conf.json')
const bot = new Telegraf(bottoken)
const pics = [
'https://pp.userapi.com/c852032/v852032200/54df2/QYhx-gTOyHM.jpg',
'https://pp.userapi.com/c852032/v852032200/54e06/XthuKPlyWjY.jpg'
]
const chatId = 'put here chat id'
const a = require('module');
(async () => {
cons result = await a()
console.log(result)
})()
// or
a.then(result => console.log(result))
const FormData = require('form-data')
async function uploadFile (file) {
const form = new FormData()
form.append(`data`, file.file, {
filename: file.name
})
const res = await new Promise((resolve, reject) => {
form.submit('https://telegra.ph/upload', (err, res) => {
let data = ''
res.on('data', chunk => data += chunk )
const sleep = timeout => new Promise(resolve => setTimeout(resolve, timeout))
!(async () => {
for (chapter of array1) {
for (article of array2) {
console.log(`i=${chapter}, j=${article}`)
await sleep(5000)
}
}
})()