chore: cleanup

This commit is contained in:
2025-07-12 02:02:03 +03:00
parent a526dbf6c6
commit 6e16c5831e
7 changed files with 19 additions and 16 deletions

View File

@@ -12,9 +12,6 @@ public class EulaAgreementButtonCommand(PrepareUserState prepareUserState) : IAu
{
public async Task ExecuteAsync(Update update, GetUserResponse user, CancellationToken ct)
{
if (update.Type != UpdateType.Message || update.Message?.From == null)
return;
await prepareUserState.AcceptEula(update, ct);
}
}

View File

@@ -1,7 +1,7 @@
using Telegram.Bot;
using Telegram.Bot.Types;
namespace JOBot.TClient.Commands;
namespace JOBot.TClient.Commands.Commands;
public class InfoCommand(ITelegramBotClient bot) : ITelegramCommand
{

View File

@@ -2,7 +2,7 @@ using JOBot.Proto;
using JOBot.TClient.Services;
using Telegram.Bot.Types;
namespace JOBot.TClient.Commands;
namespace JOBot.TClient.Commands.Commands;
public class MenuCommand(MenuService menuService) : IAuthorizedTelegramCommand
{

View File

@@ -1,9 +1,7 @@
using JOBot.TClient.Commands.Buttons;
using JOBot.TClient.Statements;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
namespace JOBot.TClient.Commands;
namespace JOBot.TClient.Commands.Commands;
public class StartCommand(PrepareUserState prepareUserState) : ITelegramCommand
{

View File

@@ -8,6 +8,8 @@ public interface IAuthorizedTelegramCommand : ITelegramCommand
{
public Task ExecuteAsync(Update update, GetUserResponse user, CancellationToken ct);
/// <exception cref="UnauthorizedAccessException">Throws if you try to use ITelegramCommand.ExecuteAsync
/// instead of IAuthorizedTelegramCommand.ExecuteAsync</exception>
Task ITelegramCommand.ExecuteAsync(Update update, CancellationToken ct)
{
throw new UnauthorizedAccessException("You do not have permission to access this command.");