Bot username not working

I have given a name for my bot inside index.js under “username: ” When I run the code my bot connects to the twitch channel but with the name of my twitch account and not the actually name I gave it under “username: ”

Btw I am creating the bot using tmi.js and node.js

Show your code with secrets removed.

You did fetch a oAuth for your botname and have actually created botname as an account?

To connect to chat has botusername you will need to:

  1. Create a new Twitch account named botusername
  2. Login to the new account
  3. Generate an OAuth token while logged into botusername
  4. Use that token in your script
1 Like

No I did not do that actually. I just got the oAuth from my main twitch account. So does this mean when I make a new twitch account for my bot that whatever name I give that twitch account I will be stuck with that name for my bot? or will I be able to change the name around in the index.js file? because when I used my own Auth for what ever reason even when I changed username around it never changed


Usernames can be changed every 3 months iirc.

Otherwise to change the name of your bot, you will need to make a new Twitch account and go thru the oAuth loop with that Twitch Account.

The bot can only authenticate using the password you used. The “password” is the oAuth. The oAuth belongs to you (in this case) so your JS file/Bot can only connect to chat “as you”

To login as another user, you need to create another account and perform an oAuth loop to get an oAuth for the other user.

1 Like

Oh ok makes sense ! thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.