Files
BotPages/Demo/Pages/InlinePage.cs
FrigaT 4aff8edbcd
All checks were successful
CI / build-test (push) Successful in 31s
Release / pack-and-publish (release) Successful in 1m12s
Доработан менеджер состояний.
2025-12-03 07:15:46 +03:00

33 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using BotPages.Core;
namespace Demo.Pages
{
public sealed class InlinePage : Page
{
public override string Id => nameof(InlinePage);
public override Task<PageResult> EnterAsync(UpdateContext ctx, CancellationToken ct)
{
var actions = new[]
{
new PageAction { Label = "⬅️ Назад", Value = "back", Placement = ActionPlacement.Inline, Row = 0 }
};
return Task.FromResult(
PageResultBuilder.Empty()
.WithText("Это страница с Inlineкнопками.")
.WithKeyboard(actions)
.Build()
);
}
public override Task<PageResult> HandleAsync(UpdateContext ctx, CancellationToken ct)
{
if (ctx.Text == "back")
return Task.FromResult(PageResultBuilder.Empty().WithNavigate(nameof(MainPage)).Build());
return Task.FromResult(PageResultBuilder.Empty().WithText("Нажмите кнопку 'Назад'.").Build());
}
}
}