matrix-lastactive
A small utility to determine when a user was last active.
How to use
Install with
npm i matrix-lastactive
To use
import { MatrixActivityTracker } from "matrix-lastactive";
const tracker = new MatrixActivityTracker({
homeserverUrl: "https://localhost",
accessToken: "ABCDE",
serverName: "localhost",
defaultOnline: false,
});
tracker.isUserOnline(
"@Half-Shot:half-shot.uk"
1000 * 60 * 60 * 24
).then((isOnline) => {
if (isOnline) {
console.log("Half-Shot is online");
} else {
console.log("Half-Shot is offline");
}
});
myfakeemitter.on("event", (event) => {
tracker.bumpLastActiveTime(event.sender);
});
Contact
If you need help with this library, please contact @Half-Shot:half-shot.uk