Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulate inline button click #98

Closed
makovez opened this issue Jun 4, 2017 · 8 comments
Closed

simulate inline button click #98

makovez opened this issue Jun 4, 2017 · 8 comments
Labels
RTFM *Questions* don't belong in the *project's issues* tracker

Comments

@makovez
Copy link

makovez commented Jun 4, 2017

How can i simulate the click of an inline keyboard button?

@Lonami
Copy link
Member

Lonami commented Jun 4, 2017

@makovez makovez closed this as completed Jun 4, 2017
@Lonami Lonami added the RTFM *Questions* don't belong in the *project's issues* tracker label Jun 16, 2017
@barsrb
Copy link

barsrb commented Jun 26, 2017

Good day. I have same problem, but can no resolve it.
Bot send message with button to user.
I need to press this button. For example - @vote bot. http://i.prntscr.com/Dap3xt1TSHSvb0e3oCRvUA.jpeg
Message - https://pastebin.com/Zs4vAVpn

Nothing interesting in message, no one info. Only in buttons i see something -

keyboardButtonRow (ID: 0x77608b83) = (buttons=['(keyboardButtonCallback (ID: 0x683a5e46) = (text=Yes – 1, data=b\'{"id":"a6a0e25","i":0}\'))']))',
'(keyboardButtonRow (ID: 0x77608b83) = (buttons=['(keyboardButtonCallback (ID: 0x683a5e46) = (text=No, data=b\'{"id":"a6a0e25","i":1}\'))']))'])),

How i can understand - i need to send data - data=b\'{"id":"a6a0e25","i":1}\' for vote "No".
But i can understand how to do this... The best for me - is example. But link to man is fine too.

Thank you!

@Lonami
Copy link
Member

Lonami commented Jun 26, 2017

@barsrb maybe @Seby2000 can help, I don't know how he solved it.

@makovez
Copy link
Author

makovez commented Jun 26, 2017

no i don't :(

@Lonami
Copy link
Member

Lonami commented Jun 26, 2017

no i don't :(

Why did you close the issue if you hadn't solved it…?

@Iriskin0
Copy link

https://lonamiwebs.github.io/Telethon/methods/messages/get_bot_callback_answer.html
It works with inline buttons

@Lonami
Copy link
Member

Lonami commented Jun 27, 2017

Thank you @Iriskin0, I guess I'll open a wiki page about it.

@akeinhell
Copy link

working example:

request = GetBotCallbackAnswerRequest(peer, data['msg_id'], data='inline_button_data'.encode())
result = client(request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTFM *Questions* don't belong in the *project's issues* tracker
Projects
None yet
Development

No branches or pull requests

5 participants