Compare commits
2 Commits
ace4e39476
...
709ef9885b
| Author | SHA1 | Date | |
|---|---|---|---|
| 709ef9885b | |||
| 001173037e |
@@ -6,6 +6,7 @@ create conf.js and paste values
|
|||||||
export const ACCESS_TOKEN = ""; // your access token you can get it from element settings
|
export const ACCESS_TOKEN = ""; // your access token you can get it from element settings
|
||||||
export const SERVER_URL = ""; // your matrix server url without trailing slash i.e. https://matrix-client.matrix.org
|
export const SERVER_URL = ""; // your matrix server url without trailing slash i.e. https://matrix-client.matrix.org
|
||||||
export const ROOM_ID = ""; // make a private room and put its id here
|
export const ROOM_ID = ""; // make a private room and put its id here
|
||||||
|
export const INTERVAL = 30; // how often to check for new notifications
|
||||||
```
|
```
|
||||||
|
|
||||||
run
|
run
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ACCESS_TOKEN, SERVER_URL, ROOM_ID } from "./conf.js";
|
import { ACCESS_TOKEN, SERVER_URL, ROOM_ID, INTERVAL } from "./conf.js";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var last_ts = Number(Deno.readTextFileSync("last_ts"));
|
var last_ts = Number(Deno.readTextFileSync("last_ts"));
|
||||||
@@ -83,5 +83,5 @@ while (true) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
await new Promise(r => setTimeout(r, 10000));
|
await new Promise(r => setTimeout(r, (INTERVAL || 30) * 1000));
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user