Setting options of method .userByUsername() causes error
The referred method is this linked: single-user-by-username
I want to get back also optional user fields with this method, using this: const user = await readOnlyClient.v2.userByUsername(userName, { 'user.fields': [ 'username', 'name', 'id', 'created_at', 'description', 'entities', 'public_metrics', 'url', 'verified'] });
but it gives error 400 back: rateLimit: { limit: 300, remaining: 299, reset: 1673469737 }, data: { errors: [ [Object] ], title: 'Invalid Request', detail: 'One or more parameters to your request was invalid.', type: 'https://api.twitter.com/2/problems/invalid-request' }
I could only check type definition files and I suppose I added options object correctly to method.
Any help is appreciated :)
did you figure out this issue? i'm running into it now and discovering just how useless a lot of the available documentation is.