Modif utils pour "require-all" + Fix refresh error
This commit is contained in:
@@ -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) })
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user