Small readability improvements

This commit is contained in:
FlorianDahn 2021-07-26 01:26:33 +02:00
parent 5f49e25458
commit 84d18f6f45

View File

@ -199,7 +199,7 @@ namespace TelegramBotBase.Controls.Hybrid
if (!result.IsFirstHandler)
return;
if (result.MessageText == null)
if (result.MessageText == null || result.MessageText == "")
return;
var button = HeadLayoutButtonRow?.FirstOrDefault(a => a.Text.Trim() == result.MessageText)
@ -328,16 +328,16 @@ namespace TelegramBotBase.Controls.Hybrid
public async override Task Action(MessageResult result, string value = null)
{
//Find clicked button depending on Text or Value (depending on markup type)
if (this.KeyboardType != eKeyboardType.InlineKeyBoard)
return;
if (result.Handled)
return;
if (!result.IsFirstHandler)
return;
//Find clicked button depending on Text or Value (depending on markup type)
if (this.KeyboardType != eKeyboardType.InlineKeyBoard)
return;
await result.ConfirmAction(this.ConfirmationText ?? "");
var button = HeadLayoutButtonRow?.FirstOrDefault(a => a.Value == result.RawData)