How to reply a tweet using the Twitter gem?

2019-07-20 23:49发布

问题:

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

回答1:

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)


回答2:

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

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