Sorry if this has been asked before, if I’m asking in the wrong place, or if the solution is easy. First time using the forums, and new to building bots for Twitch.
I’m trying to code a bot in Python (since that’s the programming language I know) for a community I am involved in. It works as a chat bot, but I also want it to be able to get information like the number of subscribers to that community’s channel. Assuming I get the required OAuth token for the channel, how would I be able to get just the number of subscribers, or find a way to get all the subscribers as a list?
Also, what is the best way to get and store these OAuth tokens that my bot would need to access this privileged information? Should it be in the same file as the python code, or should I put it into a .txt or .json file?
This is something I did not understand when making the bot (again, completely new at this). I have it able to do stuff upon people subscribing, as well as respond to commands. But setting up and keeping up to date with a webhook, that’s something I can’t seem to get my head around with setting up.
Awesome. I think what is best is for me is to poll the Subscribers API every so often, since the current bot can share the number of subscribers for the next sub goal (they currently have Nightbot in conjunction of the bot I’m coding, and one of the goals is to remove Nightbot)
While I am unsure as to how to make it poll the subs API every few minutes, I could always look for that online anyway. Regardless, thank you for the help!