AutoCleanForm FIX

- adding MessageDeleted event to AutoCleanForm for catching messages getting deleted outside of AutoCleanForm
- added OnMessageDelete invoke to DeleteMessage in DeviceSession
This commit is contained in:
FlorianDahn
2021-10-01 18:35:05 +02:00
parent ef8ca3c988
commit e0ec133209
2 changed files with 12 additions and 11 deletions
+3 -9
View File
@@ -644,18 +644,12 @@ namespace TelegramBotBase.Sessions
/// <returns></returns>
public virtual async Task<bool> DeleteMessage(int messageId = -1)
{
try
{
await RAW(a => a.DeleteMessageAsync(this.DeviceId, messageId));
return true;
}
catch (ApiRequestException)
{
await RAW(a => a.DeleteMessageAsync(this.DeviceId, messageId));
}
OnMessageDeleted(new MessageDeletedEventArgs(messageId));
return false;
return true;
}
/// <summary>