From fb68da6ab18f532a920674dc12ca9691f2e512c4 Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Wed, 20 Mar 2019 22:21:54 +0700 Subject: [PATCH] - added request contact to DeviceSession - added request location to DeviceSession --- TelegramBotBase/Sessions/DeviceSession.cs | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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 ///