From d74727cb887725265f93a730451af41151f6ae3b Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 Mar 2024 09:48:59 -0700 Subject: [PATCH] Fix bug in get-tokens Typing "BOT" (with capital letters) wouldn't save the token as the bot user. --- packages/bots/src/get-tokens.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/bots/src/get-tokens.ts b/packages/bots/src/get-tokens.ts index 96d74ff..70ae654 100644 --- a/packages/bots/src/get-tokens.ts +++ b/packages/bots/src/get-tokens.ts @@ -137,7 +137,7 @@ bot account is the same as the streamer account.\n`) } } rl.close() - return choice as string + return (choice as string).toLowerCase() } async function saveToDatabase(accessToken: AccessToken) { @@ -156,7 +156,9 @@ async function saveToDatabase(accessToken: AccessToken) { const botDatabase = new BotDatabase() await botDatabase.saveTwitchToken(accessToken, userId, userName, isBotUser) - console.log(`Saved token for ${userId} (${userName}) to database.`) + console.log( + `Saved token for ${userId} (${userName}) to database. isBotUser==${isBotUser}`, + ) const botTwitchId = await botDatabase.getPrimaryBotTwitchId() if (botTwitchId === null) {