implemented auth, added auth tools AcceptNotPreparedAttribute.cs, IAuthorizedTelegramCommand.cs
20 lines
632 B
C#
20 lines
632 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 (update.Type != UpdateType.Message || update.Message?.From == null)
|
|
return;
|
|
|
|
await prepareUserState.AcceptEula(update, ct);
|
|
}
|
|
} |