edit
This commit is contained in:
10
src/index.js
10
src/index.js
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user