As covered in your other thread.
You need to implement the oAuth loop yourself. For user Auth, that a bot would use, this means you need to throw up a webpage somewhere that handles the initial oAuth loop.
Normally you would use
As this provides a user token and a refresh token, so you oAuth once, store the two tokens then use the refresh token as needed. (oAuth validity for a chat bot is checked at bot connected to chat, so you only need to refresh when the bot boots before it connects to chat). Normally this token is valid for four hours, but when it expires the bot is not disconnected from chat.
This is intended so you can get started with running the example bot code quickly and skip learning authentication. You wouldn’t use this in production/on a live bot, as twithcapps uses implicit auth, which doesn’t give you a refresh token, so every 60 days you then have to manually go thru their flow to get a new token and load it in. And sods law $bigStreamer is using your bot, they go live and you haven’t loaded in the new oAuth token and they have no bot.
As the bot can’t auto remake the token with the client secret/refresh token, since you don’t get those from twitchapps