I make this request to Twitch:
await axios.post(
‘https://api.twitch.tv/helix/webhooks/hub’,
{
‘hub.callback’: ${process.env.URL_CALLBACK_BOT}/callback/bot
,
‘hub.mode’: ‘subscribe’,
‘hub.topic’: ${URL_TWITCH_SUBSCRIBE_EVENT}?broadcaster_id=${twitchAccountID}&first=1&user_id=${process.env.BOT_ID}
,
‘hub.lease_seconds’: ‘3636’, // 1:01h
‘hub.secret’: ${process.env.BOT_SECRET_KEY}
},
{
headers: {
Authorization: Bearer ${userToken}
,
‘Client-Id’: ${process.env.TWITCH_CLIENT_ID}
}
}
);
I can get a successful response from Twitch, but at some of this responses the life time of the subscription is different than I put on request. Anyone know what is happening??
One of responses with different life time:
{
‘hub.challenge’: ‘7wJLEZY_yOjCWWzV4iB04_4bOdBqawfl0FYY9Sr-’,
‘hub.lease_seconds’: ‘2695’,
‘hub.mode’: ‘subscribe’,
‘hub.topic’: 'https://api.twitch.tv/helix/moderation/moderators/events?
broadcaster_id=<user_id>&first=1&user_id=<bot_id>
}