This commit is contained in:
2026-04-23 04:31:19 +02:00
parent 30262c3b8d
commit b1b3152d9b
14 changed files with 292 additions and 90 deletions

View File

@@ -3,14 +3,16 @@ const { connect } = require("./twitch/websocket");
const auth = startAuthServer();
// wait until token exists before starting twitch
const waitForToken = setInterval(() => {
// wait for login before starting Twitch connection
const wait = setInterval(() => {
const token = auth.getToken();
if (token) {
clearInterval(waitForToken);
clearInterval(wait);
process.env.APP_ACCESS_TOKEN = token;
// inject token into runtime config
const config = require("./config");
config.token = token;
console.log("🚀 Starting Twitch connection...");
connect();