I have a custom keyboard with a button,For example "button1",I want to return a special value (a number) when I press "button1".Is this possible in telegram bot ?
What kind of button?
is it KeyboardButton or InlineKeyboardButton?
What you want is best done with InlineKeyboardButton with Callback Query.
If each button is gonna have value that ain't gonna change (for example button1 always will have value 1) you can use KeyboardButton and check incoming message text and assign a value according to the text received.
KeyboardButton = Buttons on the bottom of the chat (basically user keyboard-style)
InlineKeyboardButton = Buttons under messages
Most helpful comment
What kind of button?
is it KeyboardButton or InlineKeyboardButton?
What you want is best done with InlineKeyboardButton with Callback Query.
If each button is gonna have value that ain't gonna change (for example button1 always will have value 1) you can use KeyboardButton and check incoming message text and assign a value according to the text received.
KeyboardButton = Buttons on the bottom of the chat (basically user keyboard-style)
InlineKeyboardButton = Buttons under messages