🔧 Make update interval configurable
This commit is contained in:
@ -5,6 +5,9 @@
|
|||||||
# (Make sure the /api and https:// is included in the endpoint)
|
# (Make sure the /api and https:// is included in the endpoint)
|
||||||
TIMETABLE_ENDPOINT=
|
TIMETABLE_ENDPOINT=
|
||||||
TIMETABLE_TOKEN=
|
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
|
# Set the Matrix url, bot user name and auth token here
|
||||||
MATRIX_URL=
|
MATRIX_URL=
|
||||||
|
2
index.js
2
index.js
@ -126,7 +126,7 @@ setInterval(async () => {
|
|||||||
client.sendHtmlMessage(roomId, plainText(message), message);
|
client.sendHtmlMessage(roomId, plainText(message), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, process.env.TIMETABLE_INTERVAL || 1000 * 60);
|
||||||
|
|
||||||
// Handle events
|
// Handle events
|
||||||
client.on("Room.timeline", async function (event, room) {
|
client.on("Room.timeline", async function (event, room) {
|
||||||
|
Reference in New Issue
Block a user