cyxou / firefly-iii-telegram-bot

Firefly III Telegram bot for faster interaction with the service.
GNU General Public License v3.0
47 stars 7 forks source link

Feature Request: Increase or customize list of categories #21

Closed MrCaringi closed 12 months ago

MrCaringi commented 1 year ago

It is necessary to increase the quantity of categories listed by the bot,

I suggest two options

thanks in advance!

MrCaringi commented 1 year ago

Just for the records,

some findings:

Official API documentation regarding the categories endpoint: https://api-docs.firefly-iii.org/#/categories/listCategory

It seems like there is no way to increase the number of items to be returned by the endpoint, is limited to 50, but it support pagination

I propose two solutions:

SOLUTION APPROACH 1:

ask for the firts page, and repeat the request for the URL indicated in the element links.next until there is no more links.next in the API response

image image

SOLUTION APPROACH 2

to get the total page number in the first request (without a page value in the query parameter) meta.pagination.total_pages

this way you can know how many request have to be made in order to get all the categories

image

Finally, no matter which option is used, I think, in telegram can be implemented pages buttons, i.e (https://t.me/BotFather list of bots) image

Regards!

cyxou commented 12 months ago

implemented in #23