title: How to design a User Interface on Telegram App, triggered using a Bot Just like @ShopBot in Java?
body: <p>Am very fascinated on how this Telegram Bot called <a href="https://t.me/shopbot" rel="nofollow noreferrer">@ShopBot</a>
  is being developed and i want to implement a bot that actually looks like the <a href="https://t.me/shopbot" rel="nofollow noreferrer">@ShopBot</a>
  .There is a section of the Bot when you tap or click an Inline Button it triggers an Intent and displays a UI like in this picture <a href="https://i.stack.imgur.com/UIQy9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UIQy9.jpg" alt="So when you click the Inline Button Pay$142"></a></p>
  
  <p>So when you click the Inline Button Pay$142 it calls an Intent and displays this UI form <a href="https://i.stack.imgur.com/WGBd4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WGBd4.jpg" alt="enter image description here"></a></p>
  
  <p>It Calls this UI form.</p>
  
  <p>How does one do that?</p>
  
  <p>Here is My Code</p>
  
  <p>Here is my Main Class </p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) {
  // Initialize Api Context
          ApiContextInitializer.init();
  // Instantiate Telegram Bots API
          TelegramBotsApi botsApi = new TelegramBotsApi();
  // Register our bot
          try {
              botsApi.registerBot(new UI());
          } catch (TelegramApiException e) {
              e.printStackTrace();
          }
      }
  
  }
  </code></pre>
  
  <p>Here is where i have defined my Inline Keyboard Button</p>
  
  <pre><code>public class UI extends TelegramLongPollingBot {
  
      @Override
      public void onUpdateReceived(Update update) {
  // We check if the update has a message and the message has text
          if (update.hasMessage() &amp;&amp; update.getMessage().hasText()) {
              String message_text = update.getMessage().getText();
              long chat_id = update.getMessage().getChatId();
              if (update.getMessage().getText().equals("/start")) {
                  SendMessage message = new SendMessage() // Create a message object object
  
                          .setChatId(chat_id)
                          .setText("You send /start");
                  InlineKeyboardMarkup markupInline = new InlineKeyboardMarkup();
  
                  List&lt;List&lt;InlineKeyboardButton&gt;&gt; rowsInline = new ArrayList&lt;&gt;();
                  List&lt;InlineKeyboardButton&gt; rowInline = new ArrayList&lt;&gt;();
  
                  rowInline.add(new InlineKeyboardButton().setText("Update message text").setCallbackData("update_msg_text"));
  // Set the keyboard to the markup
                  rowsInline.add(rowInline);
  // Add it to the message
                  markupInline.setKeyboard(rowsInline);
                  message.setReplyMarkup(markupInline);
                  try {
                      execute(message); // Sending our message objexecute(message); // Sending our message obj
  
                  } catch (TelegramApiException e) {
                      e.printStackTrace();
                  }
              } else {
              }
          } else if (update.hasCallbackQuery()) {
  // Set variables
              String call_data = update.getCallbackQuery().getData();
              long message_id = update.getCallbackQuery().getMessage().getMessageId();
  
              long chat_id = update.getCallbackQuery().getMessage().getChatId();
              if (call_data.equals("update_msg_text")) {
                  String answer = "Updated message text";
                  EditMessageText new_message = new EditMessageText()    
  
                          .setChatId(chat_id)
                          .setMessageId(toIntExact(message_id))
                          .setText(answer);
                  try {
                      execute(new_message);
                  } catch (TelegramApiException e) {
                      e.printStackTrace();
                  }
              }
          }
      }
  
      @Override
      public String getBotUsername() {
          // Return bot username
          // If bot username is @MyAmazingBot, it must return 'MyAmazingBot
  
          return BOTUSERNAME;
      }
  
      @Override
      public String getBotToken() {
  // Return bot token from BotFather
          return BOTTOKEN;
      }
  
  }
  </code></pre>
  
  <p>How does one call an Intent using a Telegram Bot?
  Thank You.</p>