0

recently, I've started learning the tweepy module. I decided to create a simple Twitter Bot that will tweet, like and retweet. However, I still struggle to actually create a tweet. Whenever I try to use the .create_tweet() method, it throws an error saying:

  File "C:\Users\micha\OneDrive\Pulpit\BTC_ETH_price_tracker\Price-Tracker-Bot\src\bot.py", line 8, in <module>
    print(client.create_tweet(user_auth=True, text="test 2"))
  File "C:\Users\micha\AppData\Local\Programs\Python\Python310\lib\site-packages\tweepy\client.py", line 824, in create_tweet
    return self._make_request(
  File "C:\Users\micha\AppData\Local\Programs\Python\Python310\lib\site-packages\tweepy\client.py", line 126, in _make_request
    response = self.request(method, route, params=request_params,
  File "C:\Users\micha\AppData\Local\Programs\Python\Python310\lib\site-packages\tweepy\client.py", line 99, in request
    raise Forbidden(response)
tweepy.errors.Forbidden: 403 Forbidden
Forbidden

I've tried looking it up on the internet but I couldn't find anything helpful. MY code:

import tweepy
from config import CLIENT_SECRET, SCOPES, REDIRECT, CLIENT_ID, BEARER_TOKEN, API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET, MY_ID

client = tweepy.Client(BEARER_TOKEN, API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
auth = tweepy.OAuth1UserHandler(API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
api = tweepy.API(auth)

print(client.create_tweet(user_auth=True, text="test 2"))
Mike_Ś
  • 1
  • 3

0 Answers0