Please tell me how can I send a message via POST request to the streamer’s chat on twitch. First need to connect to the chat and then send a message, do I understand correctly? But I don’t know how to do it
Code:
import axios from "axios";
axios.post('https://id.twitch.tv/oauth2/token', {
client_id: 'iwnng41kyacsy2v5mvzueo69y',
client_secret: '6ujwqbnhy5ltv3l7uljc5k',
grant_type: 'client_credentials'
})
.then(function (response) {
console.log(response);
})
.catch((e) => {
console.log(e);
});
axios.get('https://api.twitch.tv/helix/search/channels?query=loserfruit', {
headers: {
'Client-Id': 'iwnng41y2v5mvzueo69y',
'Authorization': 'Bearer vz9fcq1xv0qximnykjf8x4ao0icrf5y4dv'
}})
.then(function (response) {
console.log(response);
})
.catch((e) => {
console.log(e);
});
Thank you for your attention!