forward inline keyboard along message in telegram - telegram

I want to create a message with telegram api that users could share(forward) it along its inline keyboard buttons.
I know with telegram api you can create a message that contains inline keyboard by adding inline_keyboard array in replay_markup of a message but when I forward this message inside telegram just the text part of the message forwards and buttons wont.
In brief I want to know is it possible to create a message with telegram api that when someone forwards this message inline keyboard of that message forwards too.

InlineKeyboardButton with "url" or "login_url" parameter can be forwarded.
Note: if there is another button in keyboard without "url" or "login_url" parameter whole keyboard woudn't be shown

You can't attach inline keyboard in the forwarded message, but you can add a “Share” button, and use switch_inline_query in inline keyboard.
For instance: Users can use #Sean_Bot TeleBot to send a photo with inline buttons, if they want to keep inline buttons, they should click “Share” button instead of directly forward.

Related

How to leave the keyboard available to the user in the Viber bot?

Telegram has in class telegram.ReplyKeyboardMarkup parameter one_time_keyboard (bool, optional) – Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to False.
But Viber always hides keyboards. How to make the keyboard available to the user?
Now I have one idea to draw a keyboard along with each message.

How to send a command by clicking a button in Telegram

How can I create a ReplyKeyboardButton in telegram with a specified text, which sends a specified command when it is being clicked.
For example the text is "Yes" and when I click yes, it sends /1 as a command. In the documentation creating a button just gets a text as input.
Following picture is from Telegram documentation which demonstrate the idea:
https://core.telegram.org/file/811140184/1/5YJxx-rostA/ad3f74094485fb97bd
If you make it an inline-keyboard, each button can have an associated data-value along with the button text.
At present, regular buttons return their text as the reply value in a return message.
However, If you have a unique text or unique text+emoji as the text for each button, then your command processor code can simple do a switch-case on returned message-text
If you mean that when the user presses the button, the user actually sends a command, it is not possible.
When the user presses a regular button (not inline) he just sends the text inside the button.
So the only way to do this is to write a command in the button or at least a command and parameters.
What you see in the picture is the bot that sends a message where you have to possibility to answer: pressing buttons or pressing commands in the message.
Anyway you can also use the same functions to handle a command and a button.

Telegram inline keyboard and keyboard

I have question about Telegram bot.
I want keyboard and inline keyboard, Can I enable both of the features at the same time ?
According to Telegram documentation, it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time:
InlineKeyboardMarkup
ReplyKeyboardMarkup
ReplyKeyboardRemove
ForceReply
And of course you cannot combine two or more objects together. If you wanna show keyboard and have inline keyboard too, you can show the keyboard in a message and after that send another message with inline keyboard.
Cheers,

Visual indication for inline buttons

Is there a way to show some visual indication that the inline button has been pressed in telegram bot.
I have a bit which send inline keyboard, and when I press each buttons it works perfectly fine, but there is a slight delay in getting response from the server. As there is no visual indication to show if a button has been pressed, it is confusing for uses to know if the button was pressed and end up pressing the same button several times.
there are different types of inline buttons in Telegram:
Opens URL (with url).
Forward a message (with switch_inline_query).
Insert query at the chat (with switch_inline_query_current_chat).
Button with action (with callback_data).
I suppose you are refering to the last type of button, in that case, if a user press a button you will get the callback_data via CallbackQuery, and that lets you modify the original message with editMessageText to add something like:
Button TEST pressed.
As an alternative way, after you got the callback response at your server, you can use Emoji for showing feedback to your users. Just edit the inline message and edit some relative emoji to the button text.

Adding custom buttons to send message notification using Microsoft Band SDK

I have been playing with the Microsoft Band SDK and I have figured out that it is possible to create custom tile layouts and buttons along with event click receivers like ACTION_TILE_OPENED, ACTION_TILE_BUTTON_PRESSED, and ACTION_TILE_CLOSED.
However, is it possible to add custom buttons when doing send message notifications? Such that when a message is receive, the user can swipe left and see additional action buttons he/she can tap, and also tie this button to a click handler method? I have been trying to figure this out all day, but no success.
Example:
When a text (SMS) message is receive in the band, you can swipe left to see two buttons: "Dismiss" and "Reply". I was wondering if it is possible to also create this type of notification with buttons.
No, currently there are no means to customize notifications (messages or dialogs) sent to the Band.

Resources