twikit icon indicating copy to clipboard operation
twikit copied to clipboard

Error creating a tweet building a Thread

Open AritzUMA opened this issue 1 year ago • 0 comments

Hi I get this error with this code.

      texts = [tweet1, tweet2, tweet3]#, tweet4]
      
      reply_to = None
      
      try:
          
          for text in texts:
              
              tweet_id = await client.create_tweet(text, reply_to=reply_to and reply_to.id)
          # Publicar el primer tweet
              # Generate a random sleep time between 60 and 75 seconds
              sleep_time = random.randint(60, 75)

              # Sleep for the generated time
              time.sleep(sleep_time)
              reply_to = tweet_id
              print("Tweet enviado:")
              print(text)
      except Exception as e:
          print(f"Error al enviar el tweet 1: {e}")
          continue  # Continuar con la siguiente iteración del bucle si hay un error

Error al enviar el tweet 1: {'message': "Authorization: This request looks like it might be automated. To protect our users from spam and other malicious activity, we can't complete this action right now. Please try again later. (226)", 'locations': [{'line': 18, 'column': 3}], 'path': ['create_tweet'], 'extensions': {'name': 'AuthorizationError', 'source': 'Client', 'code': 226, 'kind': 'Permissions', 'tracing': {'trace_id': '95c934e0786b5ee7'}}, 'code': 226, 'kind': 'Permissions', 'name': 'AuthorizationError', 'source': 'Client', 'tracing': {'trace_id': '95c934e0786b5ee7'}}

AritzUMA avatar Aug 12 '24 12:08 AritzUMA