PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.25k stars 175 forks source link

userTimeline Doesn't Work with max_results #401

Open KingCh1ll opened 1 year ago

KingCh1ll commented 1 year ago

Describe the bug Hi, I am unable to add a max_results option on userTimeline on the v2 endpoint. It should work since it is listed as a valid argument, but for some reason it doesn't work.

To Reproduce await bot.twitter.v2.userTimeline("IDGOESHERE", { max_results: 3 })

Version

Additional context Error: Request failed with code 400 - Invalid Request: One or more parameters to your request was invalid. (see https://api.twitter.com/2/problems/invalid-request) at RequestHandlerHelper.createResponseError (C:\Users\USER\Projects\DiscordBots\DisPing\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:103:16) at RequestHandlerHelper.onResponseEndHandler (C:\Users\USER\Projects\DiscordBots\DisPing\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:252:25) at Gunzip.emit (node:events:513:28) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

GuiEpi commented 1 year ago

Same error on:

ceednee commented 1 year ago

@GuiEpi @KingCh1ll I had to use

// const userTimeline = await readWriteClient.v2.userTimeline(userId, options); const userTimeline = await readWriteClient.v2.get('users/${userId}/tweets', options); to make it work for the time being

alkihis commented 1 year ago

Hi, Can someone make a repository repo of this issue please?