Skip to content

Commit

Permalink
Fix bug in get-tokens
Browse files Browse the repository at this point in the history
Typing "BOT" (with capital letters) wouldn't save the token as the bot
user.
  • Loading branch information
AdamLearns committed Mar 28, 2024
1 parent 2b8662f commit d74727c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bots/src/get-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit d74727c

Please sign in to comment.