diff --git a/TelegramBotBase/Sessions/DeviceSession.cs b/TelegramBotBase/Sessions/DeviceSession.cs index a72c1cb..c8cc5f4 100644 --- a/TelegramBotBase/Sessions/DeviceSession.cs +++ b/TelegramBotBase/Sessions/DeviceSession.cs @@ -334,6 +334,32 @@ namespace TelegramBotBase.Sessions await this.Client.TelegramClient.SendChatActionAsync(this.DeviceId, action); } + /// + /// Requests the contact from the user. + /// + /// + /// + /// + public async Task RequestContact(String buttonText = "Send your contact", String requestMessage = "Give me your phone number!") + { + var rck = new ReplyKeyboardMarkup(KeyboardButton.WithRequestContact(buttonText)); + + return await this.Client.TelegramClient.SendTextMessageAsync(this.DeviceId, requestMessage, replyMarkup: rck); + } + + /// + /// Requests the location from the user. + /// + /// + /// + /// + public async Task RequestLocation(String buttonText = "Send your location", String requestMessage = "Give me your location!") + { + var rcl = new ReplyKeyboardMarkup(KeyboardButton.WithRequestLocation(buttonText)); + + return await this.Client.TelegramClient.SendTextMessageAsync(this.DeviceId, requestMessage, replyMarkup: rcl); + } + /// /// Deletes a message ///