https://twitter.com/<user_displayname>/status/<tweet_id>
,并将它与您想评论的文本一起包含在内。这不是一个实际的转推,而是将该推文嵌入到您的新推文中。Tweepy可以引用转推。只需将您想要引用的推文的URL提供给API.update_status
方法中的attachment_url
即可。
Python示例:
# Get the tweet you want to quote
tweet_to_quote_url="https://twitter.com/andypiper/status/903615884664725505"
# Quote it in a new status
api.update_status("text", attachment_url=tweet_to_quote_url)
# Done!
create_tweet
方法中有一个quote_tweet_id
参数。comment = "Yep!"
quote_tweet = 1592447141720780803
client = tweepy.Client(bearer_token=access_token)
client.create_tweet(text=comment, quote_tweet_id=quote_tweet, user_auth=False)
api.update_status(stat_forme, tweet_cid)
吗?因为使用你的代码会抛出语法错误。 - Harweeapi.update_status(stat_forme, tweet_cid)
可以工作api.update_status(stat_forme)
无法工作... 403 错误请求,但如果我像这样添加状态就可以工作api.update_status(status=stat_forme)
- user4335407