Older versions of the library works better.
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?
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.
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. 😔😔
This works fine as it now passes the spam check