Channel Points API - Opt-In Requirement

Sample use case: I have an external bot command. I would like it to cost 2000 channel points. Rather, I want it to only run if the user who triggers it has at least 2000 channel points. The command then runs and sends a request to deduct their channel points total by 2000.

When a user triggers the command, it requests the channel point total from Twitch. If the user has not opted-in to sharing their points total, Twitch sends back an error code that the bot can use in logic. (For example “Sorry, you have not opted into sharing your points total with the streamer. Please opt in and try again.”

If the user has opted in, the points total is received, the bot can run logic on that, and then send a request to Twitch to deduct points from their total.