Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Twitter api回复tweet_Node.js_Twitter - Fatal编程技术网

Node.js Twitter api回复tweet

Node.js Twitter api回复tweet,node.js,twitter,Node.js,Twitter,我正在尝试使用twitnpm模块编写一个脚本来回复tweet。然而,每当我将回复中的传递给状态中的{ 解决() }) }) })

我正在尝试使用
twit
npm模块编写一个脚本来回复tweet。然而,每当我将回复中的
传递给状态中的
或回复中的
传递给状态中的
时,这似乎都会被忽略。不确定是什么问题

   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()
            })
          })

        })

您应该将参数作为
传递给\u reply\u to \u status\u id
而不是
传递给\u reply\u to \u status\u id\u str

T.get('search/tweets',{q:'golf-since:2011-07-11',count:1})。然后(函数(响应){
const userName=response.data.statuses[0].user.screen\u name;
const tweetId=response.data.statuses[0].id\u str;
T.post('status/update',{in_reply_to_status\u id:tweetId,status:`@${userName},我也喜欢高尔夫球`},(错误,数据,响应)=>{
解决()
})
})
})