Hey Guys! I developed a bot and I understand there 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? Can telegram lift this restriction? Thanks!
To be honest? 64 chars is enough as discussed on https://t.me/BotTalk/577297 the best way is to use the callback_data as a cookie.: > That's why you send "random" data and locally within your bot you map that "random" data to the actual commands (via a key-value store)
Work arround: Desing your bot to manage callback_data differently so that you never reach 64chars.
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 in my database for the string 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, 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? Any workaround to this issue?
Log in here to report bugs or suggest features. Please enter your phone number in the international format and we will send a confirmation message to your account via Telegram.
> That's why you send "random" data and locally within your bot you map that "random" data to the actual commands (via a key-value store)
Work arround: Desing your bot to manage callback_data differently so that you never reach 64chars.
How do I make the hash persist from the point the callback button is clicked to after it is clicked? Do I store the hash inside my own database?
I would suggest you to enter the @BotTalk group and ask there for more info.
The callback_data just contains info on where to search in my database for the string 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, 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? Any workaround to this issue?