ttezel / twit

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

direct_message #401

Open developerk001 opened 6 years ago

developerk001 commented 6 years ago

I am trying to use direct_message event but it is not working or not working as i expect. I think "direct_message" event will fetch data if someone send message to me. But its not working any help.

const config = require("./config");
const twit = new Twit(config);
const stream = twit.stream("user");
stream.on("direct_message", msg => {
  console.log("It Worked!");
});
ttezel commented 6 years ago

@developerk786 is this the only code you're running? And to confirm, someone is sending a DM to your account and you're not seeing this callback being called, is that right?

If you call twit.get('direct_messages', ...) does it return the direct messages you expected to see?

developerk001 commented 6 years ago

Thanks for replying but I solve in another way

GarkGarcia commented 6 years ago

Please tell us how you did it!

andre-paulo98 commented 6 years ago

@developerk001 could you please tell us what you did to solve your issue? I could really use it. Thank you.

developerk786 commented 6 years ago

Not sure but this answer might help @GarkGarcia https://stackoverflow.com/questions/42548953/reply-to-direct-messages-of-twitter-using-node-js-api-in-twitter

rkdnc commented 5 years ago

@developerk786 That solution will not work, the API has changed for Direct Messages. See this