switch to using api functions over mreq
This commit is contained in:
@@ -8,12 +8,16 @@ const { discord, sync, db } = passthrough
|
||||
const api = sync.require("../../matrix/api")
|
||||
/** @type {import("../../matrix/file")} */
|
||||
const file = sync.require("../../matrix/file")
|
||||
/** @type {import("../converters/user-to-mxid")} */
|
||||
const userToMxid = sync.require("../converters/user-to-mxid")
|
||||
|
||||
/**
|
||||
* A sim is an account that is being simulated by the bridge to copy events from the other side.
|
||||
* @param {import("discord-api-types/v10").APIUser} user
|
||||
*/
|
||||
async function createSim(user) {
|
||||
assert.notEqual(user.discriminator, "0000", "user is not a webhook")
|
||||
api.register("_ooye_example")
|
||||
const simName = userToMxid.userToSimName(user)
|
||||
const appservicePrefix = "_ooye_"
|
||||
const localpart = appservicePrefix + simName
|
||||
await api.register(localpart)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user