You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have trying button.click like this client.addEventHandler(async (event) => { if (event.message.buttons != undefined){ console.log(event.message.buttons[1][0].click()) }
and i got this error:
`Promise {
TypeError: Cannot read properties of undefined (reading 'sharePhone')
at MessageButton.click (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70:19)
at F:\pythonProject\myProject\client dexter\telbot\test.js:36:47
at _dispatchUpdate (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\client\updates.js:144:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70
async click({ sharePhone = false, shareGeo = [0, 0], password, }) {
^
TypeError: Cannot read properties of undefined (reading 'sharePhone')
at MessageButton.click (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70:19)
at F:\pythonProject\myProject\client dexter\telbot\test.js:36:47
at _dispatchUpdate (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\client\updates.js:144:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)`
The text was updated successfully, but these errors were encountered:
You might need to get the callback data from the button, and then just directly send that data to the bot.
For example, if the button's callback data would be "main_menu_button_data", you'd need to send it like so:
const result = await client.invoke(
new Api.messages.GetBotCallbackAnswer({
peer: "botusername",
msgId: <ID of message that has the button>,
data: Buffer.from("main_menu_button_data"),
})
);
i have trying button.click like this
client.addEventHandler(async (event) => { if (event.message.buttons != undefined){ console.log(event.message.buttons[1][0].click()) }
and i got this error:
`Promise {
TypeError: Cannot read properties of undefined (reading 'sharePhone')
at MessageButton.click (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70:19)
at F:\pythonProject\myProject\client dexter\telbot\test.js:36:47
at _dispatchUpdate (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\client\updates.js:144:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70
async click({ sharePhone = false, shareGeo = [0, 0], password, }) {
^
TypeError: Cannot read properties of undefined (reading 'sharePhone')
at MessageButton.click (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\tl\custom\messageButton.js:70:19)
at F:\pythonProject\myProject\client dexter\telbot\test.js:36:47
at _dispatchUpdate (F:\pythonProject\myProject\client dexter\telbot\node_modules\telegram\client\updates.js:144:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)`
The text was updated successfully, but these errors were encountered: