diff --git a/.env.sample b/.env.sample index 63ffb04..ea29f59 100644 --- a/.env.sample +++ b/.env.sample @@ -5,6 +5,9 @@ # (Make sure the /api and https:// is included in the endpoint) TIMETABLE_ENDPOINT= TIMETABLE_TOKEN= +# How often should the script query for timetable updates +# Default: 60000 (every minute) +TIMETABLE_INTERVAL= # Set the Matrix url, bot user name and auth token here MATRIX_URL= diff --git a/index.js b/index.js index f71d6c0..eef4e70 100644 --- a/index.js +++ b/index.js @@ -126,7 +126,7 @@ setInterval(async () => { client.sendHtmlMessage(roomId, plainText(message), message); } } -}, 1000); +}, process.env.TIMETABLE_INTERVAL || 1000 * 60); // Handle events client.on("Room.timeline", async function (event, room) {