carlogs99 / mvd-weather-twitterbot

Twitter bot that uses OpenAI, Open-Meteo and Twitter APIs to make a daily tweets about the weather in Montevideo.
0 stars 0 forks source link

Incorrect response from Twitter API #1

Open orhanxq0 opened 1 year ago

orhanxq0 commented 1 year ago

Error:

Warning: Entered exception!
Traceback (most recent call last):
  File "/home/robot/İndirilenler/mvd-weather-twitterbot-main/main.py", line 116, in <module>
    tweet = twitter_client.create_tweet(text=openai_response + " (1/2)...")
  File "/usr/local/lib/python3.10/dist-packages/tweepy/client.py", line 835, in create_tweet
    return self._make_request(
  File "/usr/local/lib/python3.10/dist-packages/tweepy/client.py", line 129, in _make_request
    response = self.request(method, route, params=request_params,
  File "/usr/local/lib/python3.10/dist-packages/tweepy/client.py", line 98, in request
    raise Unauthorized(response)
tweepy.errors.Unauthorized: 401 Unauthorized
Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/robot/İndirilenler/mvd-weather-twitterbot-main/main.py", line 132, in <module>
    raise ValueError("Incorrect response from Twitter API.")
ValueError: Incorrect response from Twitter API.
carlogs99 commented 1 year ago

Hi! Make sure you have a ".env" file in the same directory as main.py with all the necessary API keys. For security reasons, my ".env" file is not uploaded to this GitHub. It seems there is a problem with your Twitter access keys. If you need any further help setting that up hit me up! I was planning on writing this info on the README anyways.