[WIP] A music bot for Matrix that connects to Element Call enabled channels.
at main 24 lines 627 B view raw
1import {UserIdentifier} from "matrix-js-sdk"; 2import {createTokens} from "./utils/createTokens.ts"; 3import {BotClient} from "@/client.ts"; 4 5const userIdentifier: UserIdentifier = { 6 type: "m.id.user", 7 user: "@nyx:equinoxx.dev" 8} 9const password = process.env.MATRIX_PASSWORD 10 11const client = new BotClient({ 12 baseUrl: "https://matrix.equinoxx.dev", 13 deviceId: "matrix-music", 14 userId: userIdentifier.user, 15}) 16 17if (typeof password == "undefined") { 18 throw new Error("No password.") 19} 20const tokens = await createTokens(client, userIdentifier, password) 21 22client.setAccessToken(tokens.access_token) 23 24client.start()