diff options
Diffstat (limited to 'includes/external/school/index.js')
-rw-r--r-- | includes/external/school/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/external/school/index.js b/includes/external/school/index.js index 58947ec..00f3435 100644 --- a/includes/external/school/index.js +++ b/includes/external/school/index.js @@ -6,6 +6,11 @@ const url = config.pronote.url; const username = config.pronote.user; const password = config.pronote.password; +process.on('unhandledRejection', (e) => { + console.error(e); + process.exit(2); +}) + async function getTimetable(offset, last) { const timetable = lessons; @@ -129,8 +134,12 @@ async function display(offset) { } (async () => { + console.log("Logging in..."); + console.log("URL is", url + ", username is", username + ", password is", password); global.session = await pronote.login(url, username, password); + console.log("Gathering timetable..."); global.lessons = await session.timetable(new Date(new Date() - (86400000 * 3)), new Date(new Date().getTime() + (86400000 * 7))); + console.log("Processing..."); await updateSleepTime(0); await display(-2); |