Using a Telegram Bot, I would like to know how I can send "transparent choice buttons" like in this image.
I dug in the documentation but here, they only explain how to make custom keyboard buttons, in such a way that the android keyboard pops up with custom buttons in order for the user to choose.
With the ones in the image I uploaded, ( the buttons named "<<", "" and ">>" ) a user could vote or navigate intuitively and not be bothered with custom keyboard.
What is the code I need to send them? Then, when an user presses them, how can I handle the choice?
I'm working with Python and Linux.
Thanks in advance.
I searched but couldn't find anything.
All you need to do is implementing inline keyboards that you can find more information about them here.
And for receiving the votes from the users firstly you need a database to store them and secondly you should use callback buttons or callback queries, which are part of inline keyboard markup in telegram bot API.
Related
I am not very experienced with Qt and I have trouble doing what I want.
In my application, I search for archive files with password on a disk (that part works) and I want to ask the user for the password each time I find one new encrypted archive.
If I find multiple files while user hasn't given any password, I want the dialog for the first password to stay visible until that password is given and then the dialog for the next password can show and so on.
I use some sort of queue to remember which archives need a password, and I am trying to show and hide an unique dialog (actually a Popup) with the info of each archive and get the password from a TextField inside. In the meantime my application is doing other stuff in the c++ code like searching for archives and extracting them when a given password is OK.
My problem is that it is not really working. The dialog shows the first time, I get the first password but then the dialog doesn't show for the next password. Sometimes I can see the dialog a second time, for a few milliseconds, before it disappears without user interaction. My application is blocked because it cannot go on without the unasked passwords.
I get that I am doing something wrong but I don't get what exactly.
Can anyone help ?
I don't know if I was very clear, English is (obviously) not my mother tongue.
I found my mistake.
I did a component based on a Popup.
Inside the onClicked function of the Check or Skip buttons I was doing two things: send accepted() or refused() to trigger custom actions and then close the dialog.
I was doing that in that order, so the accepted or refused action, which among others things triggered the visibility for the "next" password dialog, occurred before the close event, which was setting the dialog visibility to false.
I switched the order and it's way better.
I feel a little silly now but at least I found it.
I've been following YouTube tutorials most of the day now and I think I've got the basic hang of forms. I'm aiming to create something like this below, which checks a users password and shows how strong it is:
This is what I have at the moment:
I'd like to know the basic theory behind how the top form works, specifically how I can take the user input of password in my form and just get it to print and update in realtime underneath below. I'm not quite sure what tool is used to do that, or for that matter what tool is used to create the colour changing box.
Any help or direction is appreciated, thanks!
Add a keyboardListener to your jtextfield. When a key is pressed get the text and do your stuff(figure out the strength, number of Uppercase etc)
Is this win32 or mfc forms, or some other tech like Qt or wxWidgets?
In both cases you will want to handle messages from the edit field as text is changed in it. This message is the EN_CHANGE message. Handle that message and you can get the text from the edit field and send messages to the strength form to tell it to change its color and text.
Add a System::Windows::Forms::KeyPressEventHandler (or similar) to the TextBox. When raised, do whatever analysis you need to do on the string and update the table below. The color changing box can be one of many implementations. It can be something as simple as a panel that changes its background with a System::Windows::Forms::Label positioned on top of it. It actually looks like that, as the text is not centered.
I need to specify a predefined text in the textarea that pops up when you click "like". How can I do that? (I am not talking about the description that you can set with og:description).
that section of the post is populated with a built-in like (from your app).
I don't think that there is a way to add text to a facebook like, unless the person who shares it wants to add a comment. If your app has special API privileges then you can probably add a personalized message. For that though, you have to apply and applications are closed at the moment. I hope this helps.
Sound like tricky to me..
Sending app request in a popup is a common scenario..
I am trying it to be something static , NO POP UP, USERs should be visible just like any other media on page, with check boxes allowing selection with a send button.
MY guess is something like this.
I need to get the list of the friends and display it with check boxes.
After user selects some particular check boxes, and clicks the send button.
I need to get the list of the friends to generate the dialogue with those ids and send the request..
But even then, As far code is concerned, I am not able to achieve this, little hints would do i guess.
here is the example I want to achieve..
https://www.facebook.com/mittromney/app_159952444141722
I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected.
The problem exists e.g. on the facebook login site.
How can I make the tab key work properly? Must I activate something in the ATL control to make this work?
Thank you!
Fabian
This article describes a way how to use IWebBrowser2 in C:
http://www.codeproject.com/KB/COM/cwebpage.aspx
In some comments below it, people have exactly the same problem. Seems IWebBrowser2 just has bug and does not translate keyboard messages (not just TAB, but also CTRL+C etc.) to the expected actions. In some comment there has been a workaround:
http://www.codeproject.com/Messages/3558959/Re-hot-key-not-work.aspx
However I have no knowledge about ActiveX so I have no idea if this is usable in your case.