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(locales[locale].name);
|
||||
|
||||
try {
|
||||
const { day, message, image } = await (await fetch(locales[locale].url + '/api/calendar/today')).json();
|
||||
console.log('<<<', message, '>>>');
|
||||
if (!message) { continue; }
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
continue;
|
||||
}
|
||||
|
||||
fs.writeFileSync(imageTmpPath, Buffer.from(await (await fetch(image)).arrayBuffer()), {encoding: 'binary'});
|
||||
let imageStream = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user