mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-03-29 02:19:51 +00:00
https://github.com/the-draupnir-project/planning/issues/104 I don't know what the fuck they are doing with the typings in the vector bot-sdk repository but whatever. https://github.com/the-draupnir-project/Draupnir/issues/1053
Matrix basic types
Do you type Matrix roomIDs, userIDs, and eventIDs as
string?
Have you ever accidentally mixed the two up?
Well fear no more, this library provides distinct types for each kind of identifier, and also a wrapper for the various ways of referring to rooms.
async function acceptInvitation(
inviteSender: StringUserID,
room: MatrixRoomID
): Promise<Result<void>> {
console.log(
`accepting invitation from ${inviteSender} to ${room.toPermalink()}`
);
return await client.joinRoom(room.toRoomIDOrAlias(), room.getViaServers());
}