Commit fa60d360 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 457fd41a
......@@ -223,13 +223,20 @@ async function userShowMessage(bot, msg, user) {
bot.editMessageText(text, opts)
let html=htmlGenerator(table)
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setContent( html );
await page.screenshot({path: 'image.png'});
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setContent( html );
await page.screenshot({path: 'image.png'});
await browser.close();
bot.sendPhoto(typeof msg.chat !== 'undefined' ? msg.chat.id : msg.message.chat.id, './image.png')
}
catch (e)
{
bot.sendPhoto(typeof msg.chat !== 'undefined' ? msg.chat.id : msg.message.chat.id, './image.png')
}
await browser.close();
bot.sendPhoto(typeof msg.chat !== 'undefined' ? msg.chat.id : msg.message.chat.id, './image.png')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment