mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 14:32:04 -04:00
[calendar] more resistant bot
This commit is contained in:
parent
8602a17b5a
commit
3dab0f8762
@ -80,9 +80,14 @@ const timer = ms => new Promise( res => setTimeout(res, ms));
|
|||||||
console.log('------------');
|
console.log('------------');
|
||||||
console.log(locales[locale].name);
|
console.log(locales[locale].name);
|
||||||
|
|
||||||
const { day, message, image } = await (await fetch(locales[locale].url + '/api/calendar/today')).json();
|
try {
|
||||||
console.log('<<<', message, '>>>');
|
const { day, message, image } = await (await fetch(locales[locale].url + '/api/calendar/today')).json();
|
||||||
if (!message) { continue; }
|
console.log('<<<', message, '>>>');
|
||||||
|
if (!message) { continue; }
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync(imageTmpPath, Buffer.from(await (await fetch(image)).arrayBuffer()), {encoding: 'binary'});
|
fs.writeFileSync(imageTmpPath, Buffer.from(await (await fetch(image)).arrayBuffer()), {encoding: 'binary'});
|
||||||
let imageStream = null;
|
let imageStream = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user