timeline.delete_tweet_by_id(tweet.in_reply_to_status_id,api)

问题描述 投票:-1回答:1

我试图使它起作用https://github.com/joaquinlpereyra/twitterImgBot它可以正常工作,看起来还可以。但是几个小时后它停止工作,出现此错误

*python3 twitterbot.py
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.7/site-packages/tweepy/binder.py", line 118, in build_path
    value = quote(self.session.params[name])
KeyError: 'id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "twitterbot.py", line 209, in <module>
    main()
  File "twitterbot.py", line 200, in main
    orders()
  File "twitterbot.py", line 118, in orders
    timeline.delete_tweet_by_id(tweet.in_reply_to_status_id, api)
  File "/home/user/Skrivebord/twitterboot/lo/bot/timeline.py", line 12, in delete_tweet_by_id
    api.destroy_status(id_to_delete)
  File "/home/user/.local/lib/python3.7/site-packages/tweepy/binder.py", line 245, in _call
    method = APIMethod(args, kwargs)
  File "/home/user/.local/lib/python3.7/site-packages/tweepy/binder.py", line 71, in __init__
    self.build_path()
  File "/home/user/.local/lib/python3.7/site-packages/tweepy/binder.py", line 120, in build_path
    raise TweepError('No parameter value found for path variable: %s' % name)
tweepy.error.TweepError: No parameter value found for path variable: id*

似乎python有som问题,因为如果我在另一台PC上进行新安装,它将工作几个小时,然后停止。奇怪

知道的人?

python tweepy
1个回答
0
投票

[这很可能是因为tweet不能回复状态,所以in_reply_to_status_id属性为None,因此以API.destroy_statusid来调用None

© www.soinside.com 2019 - 2024. All rights reserved.