Sadly, the presence API is worse than I hoped

This commit is contained in:
Cadence Ember 2025-02-11 01:37:23 +13:00
commit 381861ee8e
7 changed files with 69 additions and 19 deletions

View file

@ -409,11 +409,11 @@ async function setAccountData(type, content, mxid) {
}
/**
* @param {"online" | "offline" | "unavailable"} presence
* @param {{presence: "online" | "offline" | "unavailable", status_msg?: string}} data
* @param {string} mxid
*/
async function setPresence(presence, mxid) {
await mreq.mreq("PUT", path(`/client/v3/presence/${mxid}/status`, mxid), {presence})
async function setPresence(data, mxid) {
await mreq.mreq("PUT", path(`/client/v3/presence/${mxid}/status`, mxid), data)
}
module.exports.path = path