Update ButtonGrid.cs

- adding DeleteReplyMessage property for seperating now deleting the message from the user and the message (buttons) send by the control
This commit is contained in:
FlorianDahn 2021-06-07 01:31:41 +02:00
parent e2c485aede
commit a00aaacbfb

View File

@ -47,6 +47,11 @@ namespace TelegramBotBase.Controls.Hybrid
public bool DeletePreviousMessage { get; set; } = true; public bool DeletePreviousMessage { get; set; } = true;
/// <summary>
/// Removes the reply message from a user.
/// </summary>
public bool DeleteReplyMessage { get; set; } = true;
/// <summary> /// <summary>
/// Parsemode of the message. /// Parsemode of the message.
/// </summary> /// </summary>
@ -197,7 +202,7 @@ namespace TelegramBotBase.Controls.Hybrid
await OnButtonClicked(new ButtonClickedEventArgs(button, index)); await OnButtonClicked(new ButtonClickedEventArgs(button, index));
//Remove button click message //Remove button click message
if (this.DeletePreviousMessage) if (this.DeleteReplyMessage)
await Device.DeleteMessage(result.MessageId); await Device.DeleteMessage(result.MessageId);
result.Handled = true; result.Handled = true;