Files
2025-06-07 11:04:30 +08:00

16 lines
718 B
JavaScript

async function Token() {
const { MatrixAuth } = require('matrix-bot-sdk')
// This will be the URL where clients can reach your homeserver. Note that this might be different
// from where the web/chat interface is hosted. The server must support password registration without
// captcha or terms of service (public servers typically won't work).
const homeserverUrl = "https://chat.sob.moe";
const auth = new MatrixAuth(homeserverUrl);
// sobu: mk_sob_relEKA1axmA
// sob: mk_sob_relA3cDmA3
const client = await auth.passwordLogin("sobu", "mk_sob_relEKA1axmA");
console.log("\n\n")
console.log("Copy this access token to your bot's config: ", client.accessToken);
};Token()