2022-04-29 12:28:23
Reference Question :- https://t.me/botsbus/1466
Question From @kswami9
What's the error in given reference(question) code(BJS)
Answer:-
Heavy callback data
According Telegram Bot Api, call back data should not exceed 64 bytes
But due to long data, it is exceeding belong 64 bytes,
In my condition it got 84 bytes. It would varies as data is different for everyone.
Solution:-
We would need to use data passer through the property
By the following way you can pass your data to next command without heavy callback data.
Command :- /your_command
BJS :
var wallet = "TUiFo3gskj9AGtQnrYuumXJeTQ8szUAshp"
var cur = "TRX"
var amount = 0.0001
var user_link = "@"+user.username+""
var admin = 1028030594
var tcx = "* New Withdrawal Request From User* \n*▬▬▬▬▬▬▬▬▬▬▬*\n* UserID :* "+user.telegramid+"\n* Address:* "+wallet+"\n* Amount :* "+amount+"* "+cur+"*\n* Referrals :* 1 *User(s)*\n*▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬*\n* Bot Link:* @"+bot.name+""
var tem_passer_key = new Date().getTime(); + Math.floor(Math.random() * 1000);
var tem_passer = {
user:user,
cur: cur,
amount: amount,
wallet:wallet
}
User.setProperty(tem_passer_key,tem_passer,json)
var button =
[[{text:"Pay Auto",callback_data:"/lollauto " + tem_passer_key},{text:"Reject",callback_data:"/reject"+" "+user.telegramid+""}]]
Api.sendMessage({chat_id:admin,text:tcx,parse_mode:"Markdown", reply_markup:{inline_keyboard:button}})
Command :- /lollauto
BJS :-
if(!params){return}
//receiving data
var tem_passer = User.getProperty(params,{})
//deleting property
User.setProperty(params, null, "float");
//You can use this data according
Bot.inspect(tem_passer)
Code Developer :- @sohamdeogaonkar1
Channel :- @bots_bussiness
Please report error to me if happens
Copying and publishing code anywhere or selling the above code is strictly not allowed. Right of the above codes belong to the code owner and owner of the this channel. Still if anyone have any problem regarding copyright can contact us.
412 views09:28