Compare commits

...

2 Commits

Author SHA1 Message Date
Jan 072813adc3 Send error message when fetching timetable fails 2020-12-06 20:40:46 +01:00
Jan 64759243c0 Raise update interval to once per minute 2020-12-06 20:32:30 +01:00
1 changed files with 10 additions and 1 deletions

View File

@ -40,11 +40,20 @@ let fetchUpdates = () => {
});
} catch(e) {
console.error(e);
try {
let embed = new Discord.MessageEmbed()
.setTitle('An error has occurred.')
.setDescription(`\`\`\`js\n${e}\`\`\``)
.setColor(0xff0000);
sendEmbed(embed);
} catch(e) {
console.error(e);
}
}
}
fetchUpdates();
setInterval(fetchUpdates, 120000);
setInterval(fetchUpdates, 60000);
async function sendEmbed(embed: Discord.MessageEmbed) {