Last active
March 6, 2017 11:07
-
-
Save mkotb/61a4256573a56ab207ed257c2564eb9b to your computer and use it in GitHub Desktop.
Telegram Inline Menu Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InlineMenuBuilder builder = InlineMenu.builder(bot, event.getChat()) | |
.allowedUser(event.getMessage().getSender()) | |
.message(SendableTextMessage.markdown("*Cool Message*")) | |
.newRow() | |
.toggleButton() | |
.toggleCallback((button, newValue) -> "The value is " + newValue) | |
.newRow() | |
.inputButton("Click for name") | |
.buttonCallback((button) -> "Send me your name as a text!") | |
.textCallback((button, input) -> button.setText("Your name is " + input)) | |
.buildRow(); | |
InlineMenu subMenu = builder.subMenu() | |
.newRow() | |
.toggleButton("Give me emoji!") | |
.toggleCallback((button, newValue) -> newValue ? "\uD83D\uDC4D" : "\uD83D\uDC4E") | |
.newRow() | |
.backButton("Go back") | |
.buildMenu(); | |
builder | |
.newRow() | |
.menuButton("Sub Menu") | |
.nextMenu(subMenu) | |
.buildMenu() | |
.start(); |
How to access this functionality from the client?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to launch this code?
I mean how can we call it from main method