Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
305 stars 31 forks source link

CLI returning code: 'ERR_UNHANDLED_REJECTION' #458

Closed imcrom closed 4 months ago

imcrom commented 4 months ago

When trying to use the cli with the command

rettiwt user timeline elonmusk

it returns

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<DataValidationError>".] code: 'ERR_UNHANDLED_REJECTION'} Node.js v20.11.0

But posting a tweet works.

Rishikant181 commented 4 months ago

A data validation has occured because you tried to fetch the timeline of a user using his username instead of ID. The ID is a numeric string which can be obtained by first fetching the details of the user using the command: rettiwt user details elonmusk. From the returned data, you can get the ID field.