2022-10-15 18:51:26 +03:00

43 lines
895 B
C#

using TelegramBotBase.Base;
using TelegramBotBase.Form;
namespace AsyncFormUpdates.Forms;
public class Start : AutoCleanForm
{
public override async Task Action(MessageResult message)
{
await message.ConfirmAction();
switch (message.RawData ?? "")
{
case "async":
var afe = new AsyncFormEdit();
await NavigateTo(afe);
break;
case "async_del":
var afu = new AsyncFormUpdate();
await NavigateTo(afu);
break;
}
}
public override async Task Render(MessageResult message)
{
var bf = new ButtonForm();
bf.AddButtonRow("Open Async Form with AutoCleanupForm", "async_del");
bf.AddButtonRow("Open Async Form with Edit", "async");
await Device.Send("Choose your option", bf);
}
}