From 2c34a178ee1b6e1bf14e6adc56160cc5cb8f54cf Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Mon, 12 Oct 2020 23:16:42 +0200 Subject: [PATCH] Update DeviceSession.cs - adding caption parameter --- TelegramBotBase/Sessions/DeviceSession.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TelegramBotBase/Sessions/DeviceSession.cs b/TelegramBotBase/Sessions/DeviceSession.cs index 01e12a4..7c0fbd7 100644 --- a/TelegramBotBase/Sessions/DeviceSession.cs +++ b/TelegramBotBase/Sessions/DeviceSession.cs @@ -381,7 +381,7 @@ namespace TelegramBotBase.Sessions /// /// /// - public async Task SendPhoto(InputOnlineFile file, String name = null, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false, ParseMode parseMode = ParseMode.Default) + public async Task SendPhoto(InputOnlineFile file, String caption = null, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false, ParseMode parseMode = ParseMode.Default) { if (this.ActiveForm == null) return null; @@ -392,7 +392,7 @@ namespace TelegramBotBase.Sessions try { - m = await this.Client.TelegramClient.SendPhotoAsync(this.DeviceId, file, caption: name, parseMode: parseMode, replyToMessageId: replyTo, replyMarkup: markup, disableNotification: disableNotification); + m = await this.Client.TelegramClient.SendPhotoAsync(this.DeviceId, file, caption: caption, parseMode: parseMode, replyToMessageId: replyTo, replyMarkup: markup, disableNotification: disableNotification); OnMessageSent(new MessageSentEventArgs(m)); } @@ -417,13 +417,13 @@ namespace TelegramBotBase.Sessions /// /// /// - public async Task SendPhoto(Image image, String name, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false) + public async Task SendPhoto(Image image, String name, String caption, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false) { using (var fileStream = Tools.Images.ToStream(image, ImageFormat.Png)) { InputOnlineFile fts = new InputOnlineFile(fileStream, name); - return await SendPhoto(fts, name: name, buttons, replyTo, disableNotification); + return await SendPhoto(fts, caption: caption, buttons, replyTo, disableNotification); } } @@ -436,13 +436,13 @@ namespace TelegramBotBase.Sessions /// /// /// - public async Task SendPhoto(Bitmap image, String name, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false) + public async Task SendPhoto(Bitmap image, String name, String caption, ButtonForm buttons = null, int replyTo = 0, bool disableNotification = false) { using (var fileStream = Tools.Images.ToStream(image, ImageFormat.Png)) { InputOnlineFile fts = new InputOnlineFile(fileStream, name); - return await SendPhoto(fts, name: name, buttons, replyTo, disableNotification); + return await SendPhoto(fts, caption: caption, buttons, replyTo, disableNotification); } }