我正在尝试编写一个脚本来回复推文,使用twit
npm模块。然而,每当我通过in_reply_to_status_id_str
或in_reply_to_status_id
时,这似乎都被忽略了。不确定是什么问题?
T.get('search/tweets', { q: `golf since:2011-07-11`, count: 1 }).then(function (response) {
const userName = response.data.statuses[0].user.screen_name;
const tweetId = response.data.statuses[0].id_str;
T.post('statuses/update', { in_reply_to_status_id_str: tweetId, status: `@${userName}, I like golf too` }, (err, data, response) => {
resolve()
})
})
})
你应该把这个参数作为in_reply_to_status_id
而不是in_reply_to_status_id_str
。
T.get('search/tweets', { q: `golf since:2011-07-11`, count: 1 }).then(function (response) {
const userName = response.data.statuses[0].user.screen_name;
const tweetId = response.data.statuses[0].id_str;
T.post('statuses/update', { in_reply_to_status_id: tweetId, status: `@${userName}, I like golf too` }, (err, data, response) => {
resolve()
})
})
})