start on d->m removing reactions

This commit is contained in:
Cadence Ember
2023-09-25 17:36:27 +13:00
parent 8d3ac665c9
commit 4f807159ba
3 changed files with 56 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
// @ts-check
const Ty = require("../types")
const assert = require("assert")
const assert = require("assert").strict
const passthrough = require("../passthrough")
const { discord, sync, db } = passthrough
@@ -109,6 +109,18 @@ function getJoinedMembers(roomID) {
return mreq.mreq("GET", `/client/v3/rooms/${roomID}/joined_members`)
}
/**
* @param {string} roomID
* @param {string} eventID
* @param {string?} [relType]
* @returns {Promise<Ty.Pagination<Ty.Event.Outer<any>>>}
*/
function getRelations(roomID, eventID, relType) {
let path = `/client/v1/rooms/${roomID}/relations/${eventID}`
if (relType) path += `/${relType}`
return mreq.mreq("GET", path)
}
/**
* @param {string} roomID
* @param {string} type
@@ -207,6 +219,7 @@ module.exports.getEvent = getEvent
module.exports.getAllState = getAllState
module.exports.getStateEvent = getStateEvent
module.exports.getJoinedMembers = getJoinedMembers
module.exports.getRelations = getRelations
module.exports.sendState = sendState
module.exports.sendEvent = sendEvent
module.exports.redactEvent = redactEvent