- simplify function returns and improving memory use

This commit is contained in:
FlorianDahn 2020-03-28 10:58:25 +07:00
parent 7a7014cec3
commit 78a412c630

View File

@ -138,9 +138,7 @@ namespace TelegramBotBase.Sessions
try try
{ {
var m = await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, messageId, text, replyMarkup: markup); return await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, messageId, text, replyMarkup: markup);
return m;
} }
catch catch
{ {
@ -170,9 +168,7 @@ namespace TelegramBotBase.Sessions
try try
{ {
var m = await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, messageId, text, replyMarkup: markup); return await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, messageId, text, replyMarkup: markup);
return m;
} }
catch catch
{ {
@ -204,9 +200,7 @@ namespace TelegramBotBase.Sessions
try try
{ {
var m = await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, message.MessageId, message.Text, replyMarkup: markup); return await this.Client.TelegramClient.EditMessageTextAsync(this.DeviceId, message.MessageId, message.Text, replyMarkup: markup);
return m;
} }
catch catch
{ {
@ -383,9 +377,7 @@ namespace TelegramBotBase.Sessions
{ {
InputOnlineFile fts = new InputOnlineFile(fileStream, name); InputOnlineFile fts = new InputOnlineFile(fileStream, name);
var m = await SendPhoto(fts, buttons, replyTo, disableNotification); return await SendPhoto(fts, buttons, replyTo, disableNotification);
return m;
} }
} }
@ -404,9 +396,7 @@ namespace TelegramBotBase.Sessions
{ {
InputOnlineFile fts = new InputOnlineFile(fileStream, name); InputOnlineFile fts = new InputOnlineFile(fileStream, name);
var m = await SendPhoto(fts, buttons, replyTo, disableNotification); return await SendPhoto(fts, buttons, replyTo, disableNotification);
return m;
} }
} }
@ -496,9 +486,7 @@ namespace TelegramBotBase.Sessions
InputOnlineFile fts = new InputOnlineFile(ms, filename); InputOnlineFile fts = new InputOnlineFile(ms, filename);
var m = await SendDocument(fts, caption, buttons, replyTo, disableNotification); return await SendDocument(fts, caption, buttons, replyTo, disableNotification);
return m;
} }
/// <summary> /// <summary>
@ -524,9 +512,7 @@ namespace TelegramBotBase.Sessions
var content = ms.ToArray(); var content = ms.ToArray();
var m = await SendDocument(filename, content, caption, buttons, replyTo, disableNotification); return await SendDocument(filename, content, caption, buttons, replyTo, disableNotification);
return m;
} }
/// <summary> /// <summary>