Traitement commandes et ajout J/arrow + Fix login
This commit is contained in:
13
utils/getUserID.js
Normal file
13
utils/getUserID.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = getUserID = (async (client_id, access_token, login) => {
|
||||
return await axios.get(`https://api.twitch.tv/helix/users?login=${login}`, {
|
||||
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) })
|
||||
})
|
||||
Reference in New Issue
Block a user