Twitch bot not connecting to channel

Hey everyone,

I used to have a fully functional chatbot that I coded from scratch in c# .(don’t ask me why I’m reinventing the wheel and not using an existing library, I like to make things difficult for myself haha)

I stopped streaming for a while and only came back recently and noticed that the APIchanged a bunch and nothing was working anymore. I was able to fix everything, updated my old API calls and now almost everything works as it did before. The only thing I haven’t been able to fix is my bot’s connection to my channel.
What I mean by that is that, my entire code works as expected, the bot reacts to commands etc but when it sends messages in chat, it does so using my own account and not the one I created to write in chat.

I am connecting to IRC with the bot’s account “thecelestialwarden” but irc responds to my account and every time the bot writes in chat, it is through my own account. I have tried everything, even re-coded just the IRC connection and nothing else to make sure I didn’t change something by accident but I can’t figure out why the account can’t connect. Is there something I’m missing? I’ve searched for a really long time but I have no idea what I’m doing wrong…It’s probably something really easy and dumb but I’m really at a loss there

Here is a bit of code and the console results I get.

I am using the ip: irc.twitch.tv and the port: 6667

here is the console result (I wasn’t able to embed it in the original post)

That would indicate you are using your own accounts OAuth token, as regardless of what NICK you use when connecting, if you’re using the OAuth token from novaevermoon going through the OAuth flow, then it’ll be connected as novaevermoon. You can confirm this by using your OAuth token with the Validate Tokens endpoint https://dev.twitch.tv/docs/authentication/validate-tokens/ and it’ll return which use account is associated with that token.

If you want to send messages as thecelestialwarden, you need to log in to go through the OAuth flow while logged in to that account, so that account can grant the permissions needed to connect to chat and send messages as it.

1 Like

Oh.My.God, I feel SO dumb!
Here is what happens when you leave your code for 2 years and come back to it :upside_down_face:

Thank you so much for pointing that out, it’s working now !

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