mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 12:22:50 +02:00
switch to using api functions over mreq
This commit is contained in:
parent
7ee04d085f
commit
3bc29def41
9 changed files with 64 additions and 31 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue