chore: cleanup
This commit is contained in:
@@ -5,10 +5,10 @@ using JOBot.TClient.Infrastructure.Attributes.Authorization;
|
||||
using JOBot.TClient.Infrastructure.Extensions;
|
||||
using JOBot.TClient.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace JOBot.TClient.Core.HostedServices;
|
||||
|
||||
@@ -22,8 +22,8 @@ public sealed class BotBackgroundService(
|
||||
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
botClient.StartReceiving(
|
||||
updateHandler: HandleUpdateAsync,
|
||||
errorHandler: HandleErrorAsync,
|
||||
HandleUpdateAsync,
|
||||
HandleErrorAsync,
|
||||
cancellationToken: stoppingToken);
|
||||
|
||||
return Task.CompletedTask;
|
||||
@@ -40,7 +40,7 @@ public sealed class BotBackgroundService(
|
||||
["/info"] = scope.ServiceProvider.GetRequiredService<InfoCommand>(),
|
||||
|
||||
//Buttons
|
||||
[ButtonResource.EULAAgrement] = scope.ServiceProvider.GetRequiredService<EulaAgreementButtonCommand>(),
|
||||
[ButtonResource.EULAAgrement] = scope.ServiceProvider.GetRequiredService<EulaAgreementButtonCommand>()
|
||||
};
|
||||
|
||||
if (update.Message is { Text: { } text, From: not null })
|
||||
@@ -69,7 +69,10 @@ public sealed class BotBackgroundService(
|
||||
|
||||
await authorizedTelegramCommand.ExecuteAsync(update, user, ct);
|
||||
}
|
||||
else await command.ExecuteAsync(update, ct);
|
||||
else
|
||||
{
|
||||
await command.ExecuteAsync(update, ct);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user