JOBot/JOBot.TClient/Commands/Buttons/EulaAgreementButtonCommand.cs

18 lines
566 B
C#

using JOBot.Proto;
using JOBot.TClient.Infrastructure.Attributes.Authorization;
using JOBot.TClient.Services;
using JOBot.TClient.Statements;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
namespace JOBot.TClient.Commands.Buttons;
[AcceptNotPrepared]
public class EulaAgreementButtonCommand(PrepareUserState prepareUserState) : IAuthorizedTelegramCommand
{
public async Task ExecuteAsync(Update update, GetUserResponse user, CancellationToken ct)
{
if (!user.Eula)
await prepareUserState.AcceptEula(user, update, ct);
}
}