diff --git a/bot.js b/bot.js index a669fa9..138db45 100644 --- a/bot.js +++ b/bot.js @@ -105,11 +105,12 @@ async function readPage(kernel, sessionId) { return result.result; } -async function login(kernel, sessionId) { - const xAcct = JSON.stringify(process.env.X_ACCT); - const xPw = JSON.stringify(process.env.X_PW); - const xEmail = JSON.stringify(process.env.X_EMAIL); - const xPhone = JSON.stringify(process.env.X_PHONE); +async function login(kernel, sessionId, account) { + const prefix = account.toUpperCase(); + const xAcct = JSON.stringify(process.env[`${prefix}_USER`]); + const xPw = JSON.stringify(process.env[`${prefix}_PW`]); + const xEmail = JSON.stringify(process.env[`${prefix}_EMAIL`]); + const xPhone = JSON.stringify(process.env[`${prefix}_PHONE`]); await exec(kernel, sessionId, ` await page.goto('https://x.com/login', { waitUntil: 'networkidle' }); @@ -232,7 +233,7 @@ async function main() { console.log(`[${promptName}] Session: ${sessionId}`); try { - const url = await login(kernel, sessionId); + const url = await login(kernel, sessionId, promptConfig.account); if (!url.includes("x.com/home")) { throw new Error("Login didn't reach home page: " + url); } diff --git a/prompts.json b/prompts.json index d3f4285..c5bfd3a 100644 --- a/prompts.json +++ b/prompts.json @@ -12,7 +12,8 @@ 20 ], "minDays": 2 - } + }, + "account": "thejunipersky" }, { "name": "personality", @@ -28,6 +29,7 @@ 3 ], "minGapHours": 4 - } + }, + "account": "thejunipersky" } ]