const axios = require('axios') module.exports = async function (client_id, client_secret) { return await axios.post('https://id.twitch.tv/oauth2/token', { client_id, client_secret, grant_type: 'client_credentials' }).then(response => { //console.log(response.data) if (response.data.token_type === 'bearer') return response.data.access_token }).catch(error => { console.log(error.response.data) }) }