destial / twitchrequest

JavaScript package for getting Twitch data
MIT License
4 stars 1 forks source link

TypeError: Cannot read property 'id' of undefined #3

Open yash1441 opened 3 years ago

yash1441 commented 3 years ago
(node:1638) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
    at Client.<anonymous> (/home/runner/TwitchBot/node_modules/twitchrequest/index.js:615:65)

Getting this error upon running the code from the example.

const { Client } = require('twitchrequest');

const options = {
    channels: ["xxxxx"],
    client_id: "xxxxx",
    client_secret: "xxxxx",
    interval: 3
};

const client = new Client(options);

client.on('live', (data) => {
    console.log(`${data.name} is now live! Streaming ${data.title} on ${data.game}! Started at ${data.date}`);
});
duckodas commented 1 year ago

Bro really never got an answer