Добавьте файлы проекта.

This commit is contained in:
2025-12-02 15:57:42 +03:00
parent cf107b62a3
commit 7f69eab545
44 changed files with 1470 additions and 0 deletions

38
Demo/Pages/MainPage.cs Normal file
View File

@@ -0,0 +1,38 @@
using BotPages.Core;
namespace Demo.Pages
{
public sealed class MainPage : Page
{
public override string Id => nameof(MainPage);
public override Task<PageResult> EnterAsync(UpdateContext ctx, CancellationToken ct)
{
var actions = new[]
{
new PageAction { Label = "📌 Inline", Value = "inline", Placement = ActionPlacement.Reply, Row = 0 },
new PageAction { Label = "⌨️ Reply", Value = "reply", Placement = ActionPlacement.Reply, Row = 1 },
new PageAction { Label = "📂 Файлы", Value = "files", Placement = ActionPlacement.Reply, Row = 2 }
};
return Task.FromResult(
PageResultBuilder.Empty()
.WithText("🏠 Главная страница.\nВыберите куда перейти:")
.WithKeyboard(actions)
.Build()
);
}
public override Task<PageResult> HandleAsync(UpdateContext ctx, CancellationToken ct)
{
return ctx.Text switch
{
"📌 Inline" => Task.FromResult(PageResultBuilder.Empty().WithNavigate(nameof(InlinePage)).Build()),
"⌨️ Reply" => Task.FromResult(PageResultBuilder.Empty().WithNavigate(nameof(ReplyPage)).Build()),
"📂 Файлы" => Task.FromResult(PageResultBuilder.Empty().WithNavigate(nameof(FilesPage)).Build()),
_ => Task.FromResult(PageResultBuilder.Empty().WithText("Выберите действие с кнопок.").Build())
};
}
}
}