twitter-openapi-typescript icon indicating copy to clipboard operation
twitter-openapi-typescript copied to clipboard

Older versions of the library works better.

Open darkmasta opened this issue 1 year ago • 2 comments

With the new versions of the library, I get this error a lot frequently.

Response returned an error code
    at new ResponseError (node_modules/twitter-openapi-typescript-generated/dist/runtime.js:405:28)
    at PostApi.<anonymous> (node_modules/twitter-openapi-typescript-generated/dist/runtime.js:325:31)
    at step (node_modules/twitter-openapi-typescript-generated/dist/runtime.js:72:23)
    at Object.next (node_modules/twitter-openapi-typescript-generated/dist/runtime.js:53:53)
    at fulfilled (node_modules/twitter-openapi-typescript-generated/dist/runtime.js:44:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: false, error: null },
    [Symbol(Response internals)]: {
      url: 'https://x.com/i/api/graphql/8ED1SMuUGkOZVBEjiYUTfw/CreateTweet',
      status: 400,
      statusText: 'Bad Request',
      headers: [Headers],
      counter: 0
    }
  }
}

Surprisingly older versions work better. They get a lot less error. Why do you think this is happening? How do we mitigate against this error?

darkmasta avatar Nov 13 '24 13:11 darkmasta

The new library uses a new API. The new API has a strict anti-spam policy. I will address this issue at some point.

If you use CreateTweet or UserByScreenName, try using an older version of the library.

fa0311 avatar Nov 13 '24 16:11 fa0311

I will address this issue at some point.

I am using CreateTweet and CreateRetweet exclusively and at this point even with the older version library is barely usable. We are getting a lot of errors. 😔😔

darkmasta avatar Nov 13 '24 16:11 darkmasta

This works fine as it now passes the spam check

fa0311 avatar May 07 '25 17:05 fa0311