Ajout panel + récup infos depuis SQL + fix noms de fichiers
This commit is contained in:
13
utils/getRewardID.js
Normal file
13
utils/getRewardID.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = async function (client_id, access_token, broadcaster_id, reward_name) {
|
||||
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 => {
|
||||
let reward = response.data.data.find(reward => reward.title === reward_name)
|
||||
return reward.id
|
||||
}).catch(error => { console.log(error.response.data) })
|
||||
}
|
||||
Reference in New Issue
Block a user