13 lines
473 B
JavaScript
13 lines
473 B
JavaScript
const axios = require('axios')
|
|
|
|
module.exports = async function (client_id, access_token, broadcaster_id) {
|
|
return await axios.get(`https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id=${broadcaster_id}`, {
|
|
headers: {
|
|
'Authorization': `Bearer ${access_token}`,
|
|
'Client-Id': client_id
|
|
}
|
|
}).then(response => {
|
|
console.log(response.data)
|
|
return response.data.data[0].id
|
|
}).catch(error => { console.log(error.response.data) })
|
|
} |