d->m: Presence

This commit is contained in:
Cadence Ember 2025-02-10 15:04:34 +13:00
commit 8ad0117fd2
6 changed files with 70 additions and 1 deletions

View file

@ -408,6 +408,14 @@ async function setAccountData(type, content, mxid) {
await mreq.mreq("PUT", `/client/v3/user/${mxid}/account_data/${type}`, content)
}
/**
* @param {"online" | "offline" | "unavailable"} presence
* @param {string} mxid
*/
async function setPresence(presence, mxid) {
await mreq.mreq("PUT", path(`/client/v3/presence/${mxid}/status`, mxid), {presence})
}
module.exports.path = path
module.exports.register = register
module.exports.createRoom = createRoom
@ -440,3 +448,4 @@ module.exports.ackEvent = ackEvent
module.exports.getAlias = getAlias
module.exports.getAccountData = getAccountData
module.exports.setAccountData = setAccountData
module.exports.setPresence = setPresence