callback-data icon indicating copy to clipboard operation
callback-data copied to clipboard

Why is callback data size limited to 64?

Open PCPbiscuit opened this issue 1 year ago • 1 comments

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?

PCPbiscuit avatar Nov 11 '24 20:11 PCPbiscuit

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.

deptyped avatar Nov 11 '24 23:11 deptyped