如何解决Tweepy bot 用于回复带有图像的推文返回错误代码 431
我创建了一个机器人来回复我家时间线上的一条推文,代码如下:
import tweepy
import time
auth = tweepy.OAuthHandler('xxxx','xxxx')
auth.set_access_token('xxxx','xxxx')
twitter_api = tweepy.API(auth)
my_timeline = twitter_api.home_timeline(exclude_replies=True)
respondedToTweets = []
for tweets in my_timeline:
if tweets in respondedToTweets:
print('Skipping already replied to tweets')
pass
elif tweets not in respondedToTweets:
print('Found new tweet!')
image = twitter_api.update_with_media('ben.jpg')
twitter_api.update_status(status=image,in_reply_to_status_id=tweets.id)
my_timeline.append(tweets)
print('Sent reply')
else:
print("Didn't work :(")
time.sleep(5)
但是,我收到此错误:
tweepy.error.TweepError: Twitter error response: status code = 431
我似乎找不到与 tweepy 相关的任何信息,文档也不清楚该错误
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。