devhindo / x

post tweets from terminal
https://x-blush.vercel.app
MIT License
27 stars 2 forks source link

Add handling for reaching the limit of 50 tweets per day. #58

Open devhindo opened 1 month ago

devhindo commented 1 month ago

[POST] /api/tweets/post status=500

returns failed to unmarshal response when the limit is reached

or it just returns nothing.

It should return daily limit reaches as the app complies with the free plan. Counter resets tomorrow or whatever.

Error

 error TwitterResponseError
    at request (/var/task/src/server/.next/server/chunks/790.js:4098:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async rest (/var/task/src/server/.next/server/chunks/790.js:4127:22)
    at async POST (/var/task/src/server/.next/server/app/api/tweets/post/route.js:175:18)
    at async /var/task/src/server/.next/server/chunks/501.js:5773:37 {
  status: 429,
  statusText: 'Too Many Requests',

related to #47

mesb1 commented 1 month ago

Not only 50, for example some day it someone bought some plan, so it must be limited to amount of included limit.