hourly rp room screenshot

This commit is contained in:
Lamp 2020-10-04 14:59:41 -07:00 committed by GitHub
parent 520fa6c2cb
commit 276a2afcc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,7 @@ global.screenshotter = {
await page.goto('https://www.multiplayerpiano.com/lobby'); await page.goto('https://www.multiplayerpiano.com/lobby');
try {await page.evaluate(function () { try {await page.evaluate(function () {
document.getElementById('modal').click(); document.getElementById('modal').click();
MPP.client.uri = "wss://mpp_proxy.qonq.gq"; //MPP.client.uri = "wss://mpp_proxy.qonq.gq";
});} catch(e) {console.error(e.message)} });} catch(e) {console.error(e.message)}
await new Promise(resolve => setTimeout(resolve, 5000)); await new Promise(resolve => setTimeout(resolve, 5000));
let screenshot = await page.screenshot({ type: 'png' }); let screenshot = await page.screenshot({ type: 'png' });
@ -20,6 +20,19 @@ global.screenshotter = {
} catch (error) { } catch (error) {
await dClient.channels.resolve(config.channels.mpp_screenshot).send(`:warning: ${error.stack}`); await dClient.channels.resolve(config.channels.mpp_screenshot).send(`:warning: ${error.stack}`);
} }
try {
await page.evaluate(function () {
MPP.client.setChannel("✧𝓡𝓟 𝓡𝓸𝓸𝓶✧");
});
await new Promise(resolve => setTimeout(resolve, 5000));
let screenshot = await page.screenshot({ type: 'png' });
let filename = `Screenshot of www.multiplayerpiano.com/✧𝓡𝓟 𝓡𝓸𝓸𝓶✧ @ ${new Date().toISOString()}.png`;
let attachment = new Discord.MessageAttachment(screenshot, filename);
await dClient.channels.resolve("762430891707727902").send(attachment);
// todo put id in config but github web editor gay
} catch(error) {
await dClient.channels.resolve("762430891707727902").send(`:warning: ${error.stack}`);
}
try { try {
await page.goto('http://ourworldofpixels.com'); await page.goto('http://ourworldofpixels.com');
await page.evaluate(function (owopcaptcha) { await page.evaluate(function (owopcaptcha) {