Stream direct messages using node.js API in twit

nodejs
directmessages
javascript

#1

Has anyone successfully used twit package in nodejs and streamed direct messages? If yes,
please let me know how you have done it.


#2

Am still waiting for an answer


#3

You’ll need to listen to the user streams messages. What endpoint are you connecting to?


#4

Thanks Andy. Got this working.
Below is the code in node.js

var stream = T.stream(‘user’);
stream.on(‘direct_message’, function(eventMsg)

The above call works. What I could not find easily was that, I had to set only the text and the screen_name to reply to a direct message.

Thanks


#5

Hi,

Were you able to reply to the direct message received using twit.
Can you paste the code snippet