簡體   English   中英

如何使用Tweepy回復特定用戶的最新推文?

[英]How to reply to a particular user's most recent tweet using Tweepy?

我找到了這段代碼

toReply = "xxx" 
api = tweepy.API(auth)



tweets = api.user_timeline(screen_name = toReply, count=1)

for tweet in tweets:
api.update_status("@" + toReply + " my reply", in_reply_to_status_id = tweet.id)

但這不是我想要的。 它只是回復最新的推文。 我希望該機器人每次xxx鳴叫時都回復。 我應該更改我的代碼嗎?

while True:
  for tweet in api.user_timeline(...):

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM