I’m trying to add users automatically (when requested) to an array and hopefully not having to refresh my code for a chatbot. The only way I can think of is to manually load the Twitch user names and then reload the program. I’m thinking there is a better/automated way to do this?
And the second part, is my oauth token keeps expiring after a few days. I thought oauth tokens were supposed to last a few weeks? Is anyone else having this problem and if so, is there a good/best practice I should be following?
I’m new to coding so sorry if these questions seem basic. Thank you for your time!
I want to add the users to the array so the chatbot knows to enters their chat. Not sure the best way to implement this. This is completely voluntary on the user’s part.
If the joining mechanism is that users go to the bots own channel and writes !join then you can read that from chat.
If the joining mechanism is a website then you need to devise a way to send messages to a running instance of the bot. Personally I use Redis PubSub to send messages in/out of a running instance.
But you could also add the user to a database and have the bot check the database for changes every minute or so.