- 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:
@@ -8,12 +8,18 @@ using TelegramBotBase.Form;
|
||||
|
||||
namespace TelegramBaseTest.Tests
|
||||
{
|
||||
public class SimpleForm : FormBase
|
||||
public class SimpleForm : AutoCleanForm
|
||||
{
|
||||
|
||||
public SimpleForm()
|
||||
{
|
||||
this.DeleteSide = eSide.Both;
|
||||
this.DeleteMode = eDeleteMode.OnLeavingForm;
|
||||
}
|
||||
|
||||
public override async Task Opened()
|
||||
{
|
||||
await this.Device.Send("Hello world! (send 'back' to get back to Start)");
|
||||
await this.Device.Send("Hello world! (send 'back' to get back to Start)\r\nOr\r\nhi, hello, maybe, bye and ciao");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,6 @@ namespace TelegramBaseTest.Tests
|
||||
|
||||
String LastMessage { get; set; }
|
||||
|
||||
public override async Task Init(params object[] param)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override async Task Opened()
|
||||
{
|
||||
@@ -30,12 +26,6 @@ namespace TelegramBaseTest.Tests
|
||||
await this.Device.Send("Ciao from Form 1");
|
||||
}
|
||||
|
||||
public override async Task Load(MessageResult message)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override async Task Action(MessageResult message)
|
||||
{
|
||||
|
||||
@@ -15,10 +15,6 @@ namespace TelegramBaseTest.Tests
|
||||
public class TestForm2 : FormBase
|
||||
{
|
||||
|
||||
public override async Task Init(params object[] param)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override async Task Opened()
|
||||
{
|
||||
@@ -30,10 +26,6 @@ namespace TelegramBaseTest.Tests
|
||||
await this.Device.Send("Ciao from Form 2");
|
||||
}
|
||||
|
||||
public override async Task Load(MessageResult message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override async Task Action(MessageResult message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user