The datatype of the optional userinput for Channel Points Event Message is just a string, but it really should be an “sub_message” datatype since user can input the emotes into the user input within the reward for the channel points.
As I can see on the another examples of the docs such as Channel Subscriptions Event Message, it has the sub_message datatype, hence the inconsistent datatype.
The ideally outcome of json response of Channel Points Event Message should be like this (see the userinput field as it is in sub_message datatype and I have tried to make this so it is focused on the datatype itself than bloated data):
{
"type": "reward-redeemed",
"data": {
"timestamp": "...",
"redemption": {
"id": "...",
"user": {
"id": "...",
"login": "",
"display_name": ""
},
"channel_id": "...",
"redeemed_at": "...",
"reward": {
"id": "...",
"channel_id": "...",
"title": "say something on stream",
"prompt": "talking bot \n",
"cost": 10,
"is_user_input_required": true,
"is_sub_only": false,
"image": {
...
},
"default_image": {
...
},
"background_color": "#00C7AC",
"is_enabled": true,
"is_paused": false,
"is_in_stock": true,
"max_per_stream": { "is_enabled": false, "max_per_stream": 0 },
"should_redemptions_skip_request_queue": true
},
"user_input": {
"message": "A Twitch baby is born! KappaHD",
"emotes": [
{
"start": 23,
"end": 7,
"id": 2867
}
]
},
"status": "FULFILLED"
}
}
}
I am not sure if I should reported this as well in the Issues · twitchdev/issues · GitHub, but please let me know if I should. It is not a docs issue, but an pubsub issue.
For the reference, I am using pubsub because of twitchlib.pubsub in a C# project and cannot moved to eventsub.