WIP: implemented registration and EULA accept, WIP on auth issue
This commit is contained in:
@@ -1,22 +1,14 @@
|
||||
using JOBot.TClient.Core.Services;
|
||||
using Telegram.Bot;
|
||||
using JOBot.TClient.Commands.Buttons;
|
||||
using JOBot.TClient.Statements;
|
||||
using Telegram.Bot.Types;
|
||||
using Telegram.Bot.Types.Enums;
|
||||
|
||||
namespace JOBot.TClient.Commands;
|
||||
|
||||
public class StartCommand(ITelegramBotClient bot, UserService userService) : ITelegramCommand
|
||||
public class StartCommand(PrepareUserState prepareUserState) : ITelegramCommand
|
||||
{
|
||||
private const string ReturnMessage = "Привет! Я JOBot, помощник по поиску работы в IT.";
|
||||
public async Task ExecuteAsync(Update update, CancellationToken ct)
|
||||
{
|
||||
await userService.RegisterAsync(
|
||||
update.Message!.Chat.Id,
|
||||
update.Message.Chat.Username);
|
||||
|
||||
await bot.SendMessage(chatId: update.Message.Chat.Id,
|
||||
"Продолжая, вы принимаете политику конфиденциальности и правила сервиса" +
|
||||
"\nhttps://hh.ru/article/personal_data?backurl=%2F&role=applicant" +
|
||||
"\nhttps://hh.ru/account/agreement?backurl=%2Faccount%2Fsignup%3Fbackurl%3D%252F%26role%3Dapplicant&role=applicant",
|
||||
cancellationToken: ct);
|
||||
await prepareUserState.TryToPrepareUser(update, ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user