is this restriction such that only 64 characters is allowed in the callback_data.
I currently use the callback buttons to pass string formed by combination of user ids, product ids, order ids etc
These ids grow over time as my users make more and more transactions and do more actions. Once the string reached the threshold of 64 characters it will crash my telegram bot! Its a ticking time bomb!
Is there any workaround to this issue? Thanks!
Save the data in a lookup table and send a generated id as callback_data. You could also try base64 encoding
Hey! I implemented a solution: Basically I saved the string into a text type field in my postgres database (~64,000 characters) before the callback happens. The callback_data just contains info on where to search the string in my database after the callback_data is sent. I encountered a new problem with this: When the user presses 2 different callback button on the same page in quick succession before the first callback button is resolved, This crashes the bot as the 2nd string overwrites the 1st string before the first callback_data gives command to search the database. Will the hash map method u recommend meet the same problem given it also saves the data into own database before the callback?
Обсуждают сегодня