Ajout panel + récup infos depuis SQL + fix noms de fichiers

This commit is contained in:
Zachary Guénot
2023-05-10 01:53:55 +02:00
parent 172f811e91
commit de01c981f8
14 changed files with 162 additions and 58 deletions

13
utils/getRewardID.js Normal file
View 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) })
}