code: protected function compileKeyboard(Keyboard $keyboard)
      {
          $firstButton = collect($keyboard->getButtons())->first();
  
          if ($firstButton instanceof PayloadButton || $firstButton instanceof UrlButton) {
              return $this->compileInlineKeyboard($keyboard);
          }
  
          return $this->compileReplyKeyboard($keyboard);
      }
docs: Compile keyboard.
  
  @param Keyboard $keyboard
  
  @return mixed