This is the code and i dont know how to fix this. I am very green here just testing some stuff

  1. import tweepy

  2. import time

  3. api_key = “”

  4. api_secret = “”

  5. bearer_token = “”

  6. access_token = “”

  7. access_token_secret = “”

  8. client = tweepy.Client(bearer_token, api_key, api_secret, access_token, access_token_secret)

  9. auth = tweepy.OAuth1UserHandler(api_key, api_secret, access_token, access_token_secret)

  10. api = tweepy.API(auth)

  11. class MyStream(tweepy.StreamingClient):

  12. def on_tweet(self, tweet):
    
  13.     try:
    
  14.         print(tweet.text)
    
  15.         client.like(tweet.id)
    
  16.     except Exception as error:
    
  17.         print(error)
    
  18. time.sleep(5)
    
  19. stream = MyStream(bearer_token=bearer_token)

  20. stream.add_rules(tweepy.StreamRule(“#Python -is:retweet -is:reply”), dry_run=True)

  21. stream.filter()

It looks like you’re using both v1.1 API with api = tweepy.API(auth) and v2 API with client = tweepy.Client - it may be better to remove the redundant v1.1 API stuff and just have the v2 code: Streaming — tweepy 4.10.1 documentation

Yeah i got suspended i used 88 Seconds interval…