* README tweaks

This commit is contained in:
2025-08-02 03:36:48 +04:00
parent 7d1ce6ea22
commit 692f0e0875
3 changed files with 11 additions and 5 deletions
+6 -3
View File
@@ -55,9 +55,10 @@ using Telegrator.Annotations;
[MessageHandler]
public class HelloHandler : MessageHandler
{
public override async Task Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
public override async Task<Result> Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
{
await Reply("Hello, world!", cancellationToken: cancellation);
return Result.Ok();
}
}
@@ -77,9 +78,10 @@ using Telegrator.Annotations;
[CommandHandler, CommandAllias("start", "hello"), ChatType(ChatType.Private)]
public class StartCommandHandler : CommandHandler
{
public override async Task Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
public override async Task<Result> Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
{
await Responce("Welcome!", cancellationToken: cancellation);
return Result.Ok();
}
}
@@ -96,11 +98,12 @@ using Telegrator.Annotations;
[CommandHandler, CommandAllias("first"), NumericState(SpecialState.NoState)]
public class StateKeepFirst : CommandHandler
{
public override async Task Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
public override async Task<Result> Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
{
container.CreateNumericState();
container.ForwardNumericState();
await Reply("first state moved (1)", cancellationToken: cancellation);
return Result.Ok();
}
}
+5 -1
View File
@@ -40,7 +40,6 @@ using Telegrator.Hosting.Web;
TelegramBotWebHostBuilder builder = TelegramBotWebHost.CreateBuilder(new TelegramBotWebOptions()
{
Args = args,
WebhookUri = "https://you-public-host.ru/bot"
ExceptIntersectingCommandAliases = true
});
@@ -66,6 +65,11 @@ telegramBot.Run();
"TelegramBotClientOptions": {
"Token": "YOUR_BOT_TOKEN"
}
"TelegratorWebOptions": {
"WebhookUri" = "https://you-public-host.ru/bot",
"DropPendingUpdates": true
}
}
```
-1
View File
@@ -38,7 +38,6 @@ using Telegrator.Hosting;
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new TelegramBotHostBuilderSettings()
{
Args = args,
DescendDescriptorIndex = false,
ExceptIntersectingCommandAliases = true
});