Modif utils pour "require-all" + Fix refresh error

This commit is contained in:
Zachary Guénot
2023-05-11 01:23:54 +02:00
parent 6bc5e67cbc
commit e5526cc908
16 changed files with 39 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
const axios = require('axios')
module.exports = async function (client_id, access_token, broadcaster_id, reward_name) {
module.exports = getRewardID = (async (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}`,
@@ -11,4 +11,4 @@ module.exports = async function (client_id, access_token, broadcaster_id, reward
let reward = response.data.data.find(reward => reward.title === reward_name)
return reward.id
}).catch(error => { console.log(error.response.data) })
}
})