setUserPower should account for room version 12

This commit is contained in:
Cadence Ember
2026-01-07 15:38:09 +13:00
parent 55e0e5dfa1
commit 4bea696a5a
29 changed files with 199 additions and 133 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ const passthrough = require("../src/passthrough")
Object.assign(passthrough, {db, sync})
const api = require("../src/matrix/api")
const utils = require("../src/matrix/utils")
const mreq = require("../src/matrix/mreq")
const rooms = db.prepare("select room_id from channel_room").pluck().all()
@@ -25,7 +26,7 @@ const rooms = db.prepare("select room_id from channel_room").pluck().all()
await api.leaveRoom(roomID, mxid)
}
}
await api.setUserPower(roomID, "@_discord_bot:cadence.moe", 0)
await utils.setUserPower(roomID, "@_discord_bot:cadence.moe", 0, api)
await api.leaveRoom(roomID)
} catch (e) {
if (e.message.includes("Appservice not in room")) {