- adding Delete Options for Both sides to AutoCleanForm

- general Performance improvements
- Adding MessageReceived Event to DeviceSession, will be called before "message loop"
- AutoCleanForm optimized and clean process added to public function MessageCleanup (so you could call on your own)
- IsGroup for DeviceSession fixed to correct test
- IsChannel added to DeviceSession

Examples:
- SimpleForm (#1) derived now from AutoCleanForm to show deletion mode for both sides
This commit is contained in:
FlorianDahn
2019-05-04 16:32:48 +02:00
parent 3a78a98b9e
commit 4f1eae543d
9 changed files with 144 additions and 54 deletions
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot.Types;
namespace TelegramBotBase.Base
{
public class MessageReceivedEventArgs
{
public int MessageId
{
get
{
return this.Message.MessageId;
}
}
public Message Message { get; set; }
public MessageReceivedEventArgs(Message m)
{
this.Message = m;
}
}
}
+4
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Sessions;
namespace TelegramBotBase.Base
{
@@ -23,6 +24,9 @@ namespace TelegramBotBase.Base
}
}
public DeviceSession Device
{ get; set; }
/// <summary>
/// The message id
/// </summary>
+8 -8
View File
@@ -9,18 +9,18 @@ namespace TelegramBotBase.Base
{
public class MessageSentEventArgs
{
public int MessageId { get; set; }
public int MessageId
{
get
{
return this.Message.MessageId;
}
}
public Message Message { get; set; }
public MessageSentEventArgs()
public MessageSentEventArgs(Message message)
{
}
public MessageSentEventArgs(int MessageId, Message message)
{
this.MessageId = MessageId;
this.Message = message;
}