[英]Tweet with Spring-Social-Twitter Api inReplyToStatus doesn't work
我正在嘗試發送一條推文作為對我通過查詢找到的另一條推文的響應(回復)。
但是雖然我打電話給https://docs.spring.io/spring-social-twitter/docs/current/apidocs/org/springframework/social/twitter/api/TweetData.html#inReplyToStatus(long)並傳遞正確的狀態 ID,該推文似乎不是對原始推文的回復。
我在 spring boot 應用程序中使用org.springframework.social:spring-social-twitter:jar:1.1.0.RELEASE
並且我也嘗試了最新的版本1.1.2.RELEASE
,但仍然不起作用。
相關代碼:
// Tweet tweet comes from a query
// String statusText is some plain text
final Long inReplyToStatus = tweet.getId();
final TweetData tweetData = new TweetData(statusText);
// try to make it a reply, TODO: doesn't work
tweetData.inReplyToStatus(inReplyToStatus);
// send tweet, but doesn't look like an answer.
final Tweet newTweet = this.twitterTemplateFactory.timelineOperations().updateStatus(tweetData);
你有什么問題嗎? 我是否必須通過以“@<usernameOfTheOriginalTweet> ...”開頭的statusText
使其成為老派的回復?
幫助表示贊賞。
我的猜測是正確的。 如果您希望您的答案顯示為真正的回復,您必須設置“inReplyToStatus”字段並以“@”開頭 statusText。
問題解決了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.