deptyped / callback-data

Easy callback data management for inline keyboards
https://npmjs.com/callback-data
28 stars 2 forks source link

Why is callback data size limited to 64? #13

Open PCPbiscuit opened 1 week ago

PCPbiscuit commented 1 week ago

Is there any reason why it is so?

const CALLBACK_DATA_SIZE_LIMIT = 64;

Some of my callback are quite big and I'm getting size overflow error. I was wondering if it would be possible to change to a bigger number or make it changeable?

deptyped commented 1 week ago

callback_data has a size limit, this is mentioned in the official docs. If you make CALLBACK_DATA_SIZE_LIMIT bigger you will just get an error from Telegram after a network request.

Possible solution is to use storage, store data and use short identifiers in callback_data. When you get an update, use the identifier from callback_data to retrieve the data from the storage.