* README tweaks
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ using Telegrator.Hosting;
|
||||
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new TelegramBotHostBuilderSettings()
|
||||
{
|
||||
Args = args,
|
||||
DescendDescriptorIndex = false,
|
||||
ExceptIntersectingCommandAliases = true
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user