chore: cleanup

This commit is contained in:
2025-07-25 16:37:42 +03:00
parent 7ceb8f656e
commit b15a77557e
28 changed files with 224 additions and 198 deletions

View File

@@ -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;
}