ttezel / twit

Twitter API Client for node (REST & Streaming API)
4.31k stars 568 forks source link

user stream not working for follow event #435

Open NilanjanaLodh opened 6 years ago

NilanjanaLodh commented 6 years ago
var stream = T.stream('user');

stream.on('follow', onfollow);

function onfollow(event) {
    console.log('Someone followed you!');
    console.log(event.source);
}

the onfollow function is not being called inspite of having a follow event. But the same thing works on using the 'message' event.

ttezel commented 6 years ago

Hmm are you initializing the stream before the follow event occurs? Can you confirm that the user being followed is the one whose account you're connecting to in this code? Another thing to check is listen on user_event events - this is emitted for any event to do with your account.