Detecting expired oauth token during connection to IRC

I usually make a call to

https://api.twitch.tv/kraken/

With the oAuth in the header to confirm the User ID and Username.

Just in case I changed the Username of the bot, so I can join the right channels.

Works a little better than trying to connect to IRC and getting the Invalid Password response