【问题标题】:"direct_message" event not working JavaScript (node js)“direct_message”事件不工作 JavaScript(节点 js)
【发布时间】:2018-06-15 14:28:14
【问题描述】:

我正在开发 twit API。当有人向我发送消息时将触发事件“direct_message”。

我认为但它不能正常工作。

这是我的代码:

const config = require("./config");
const twit = new Twit(config);
const stream = twit.stream("user");
stream.on("direct_message", msg => {
  console.log("It Worked")l;
});

没有回应!

【问题讨论】:

  • 谁发出direct_message事件??
  • 你实现require('twit') api 对吗??
  • var Twit = require('twit')
  • 你的应用有读写权限吗?
  • 是的,先生,所有其他事件都像关注事件一样运行良好。对不起,console.log("It Worked")1;因为那 1 它不在我的代码中。

标签: javascript node.js api twitter


【解决方案1】:

我不太确定,但是这个 1 应该在那里吗?

  console.log("It Worked")l;

【讨论】:

  • 抱歉,这是我的打字错误。
猜你喜欢
  • 2015-08-16
  • 1970-01-01
  • 2015-03-04
  • 1970-01-01
  • 2016-09-18
  • 1970-01-01
  • 2017-05-23
  • 1970-01-01
  • 2014-05-18
相关资源
最近更新 更多