Open zarlicho opened 1 month ago
try .click({})
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've not ran this command myself, so I don't know if it will work. But I found it in the docs, and it seems like exactly what you'd need to do: https://gram.js.org/tl/messages/GetBotCallbackAnswer
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 {