【发布时间】:2020-10-04 05:03:47
【问题描述】:
我尝试回答从信息流中获得的推文。我已阅读 this 文章,但不知何故它对我不起作用。该推文已发布,但不是作为回复,并且在我返回的 JSON 中是 in_reply_to_status_id: null
这是我的代码:
stream.on('tweet', function (tweet) {
if ((tweet.text.includes("Oh") || tweet.text.includes("oh") || tweet.text.includes("O") || tweet.text.includes("o")) && (tweet.text.includes("gott") || tweet.text.includes("Gott"))){
// console.log(tweet)
const tweetId = tweet.id;
T.post('statuses/update', { in_reply_to_status_id: tweetId, status: 'Oh Gott' }, (err, data, response) => {
console.log(data)
})
}
})
【问题讨论】: