如何使用Tweepy回复特定用户的最新推文?

时间:2016-07-24 23:22:03

标签: python twitter bots 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时都会回复。我应该在代码中更改什么?

1 个答案:

答案 0 :(得分:2)

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