Telegram Request Phone Number or Location

· 기능

sgcWebSockets 2022.1부터 Telegram 클라이언트 컴포넌트는 봇으로 로그인했을 때 사용자에게 전화번호나 위치를 요청할 수 있어요.

아래에서 Delphi, CBuilder, .NET 예제 코드를 확인할 수 있어요.

Delphi 예제 

oReplyMarkup := TsgcTelegramReplyMarkupShowKeyboard.Create;
Try
  oReplyMarkup.AddButtonTypeRequestPhoneNumber('Give me your phone');
  sgcTelegram.SendTextMessage('123456', 'Please provide the information below', nil, oReplyMarkup);
Finally
  oReplyMarkup.Free;
End; 

CBuilder 

oReplyMarkup = new TsgcTelegramReplyMarkupShowKeyboard();
oReplyMarkup->AddButtonTypeRequestPhoneNumber("Give me your phone");
sgcTelegram->SendTextMessage("123456", "Please provide the information below", null, oReplyMarkup);
oReplyMarkup->Free(); 

.NET 예제 

oReplyMarkup = new TsgcTelegramReplyMarkupShowKeyboard();
oReplyMarkup.AddButtonTypeRequestPhoneNumber("Give me your phone");
sgcTelegram.SendTextMessage("123456", "Please provide the information below", null, oReplyMarkup); 

Telegram 

봇이 메시지를 보내면 사용자에게 전화번호를 공유할지 묻는 버튼이 표시돼요.

사용자가 전화번호 공유에 동의하면 전화번호가 포함된 새 메시지가 전송돼요.