How to reply a tweet using the Twitter gem?

2019-07-21 00:23发布

r = 569186681850601472

client.update('@ooidesigns work', in_reply_to_tweet_id: r)

I'm trying to reply a tweet using the twitter gem and the Client (Twitter::REST) class, but only the the message is tweeted and it does not reply the tweet. Any help is appreciated

2条回答
我命由我不由天
2楼-- · 2019-07-21 00:29

Ok, so 569186681850601472 tweet is this, right? It is made by @Ksweeg user and not by @ooidesigns. Therefore, in order to reply to this tweet, you should specify @Ksweeg in your tweet text:

r = 569186681850601472

client.update('@Ksweeg test tweet', in_reply_to_status_id: r)
查看更多
兄弟一词,经得起流年.
3楼-- · 2019-07-21 00:47

I believe you are looking to use in_reply_to_status_id e.g.

client.update('@ooidesigns work', in_reply_to_status_id: 569186681850601472)

查看更多
登录 后发表回答