7 #25

Merged
Lisoveliy merged 11 commits from 7 into dev 2025-07-25 17:38:02 +02:00
2 changed files with 23 additions and 2 deletions
Showing only changes of commit 8018cb6496 - Show all commits

View File

@ -98,4 +98,11 @@ public class PrepareUserService(ITelegramBotClient bot, User.UserClient userClie
string.Format(TextResource.AskForAuth, [url.RegistrationUrl]), string.Format(TextResource.AskForAuth, [url.RegistrationUrl]),
cancellationToken: ct); cancellationToken: ct);
} }
public async Task SelectCv(Update update, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(update.Message?.From);
await _bot.SendMessage(update.Message.From.Id, "Давайте выберем одно из доступных резюме:", cancellationToken: ct); //TODO: https://git.lisoveliy.su/Lisoveliy/JOBot/issues/9
}
} }

View File

@ -1,7 +1,6 @@
using JOBot.Proto; using JOBot.Proto;
using JOBot.TClient.Services; using JOBot.TClient.Services;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using User = JOBot.Proto.User;
namespace JOBot.TClient.Statements; namespace JOBot.TClient.Statements;
@ -38,7 +37,7 @@ public class PrepareUserState(PrepareUserService prepareUserService, MenuService
} }
/// <summary> /// <summary>
/// Continue prepare stage /// Check user logged
/// </summary> /// </summary>
/// <param name="user"></param> /// <param name="user"></param>
/// <param name="update"></param> /// <param name="update"></param>
@ -50,6 +49,21 @@ public class PrepareUserState(PrepareUserService prepareUserService, MenuService
await prepareUserService.Auth(update, ct); await prepareUserService.Auth(update, ct);
return; return;
} }
await OnAuthStage(user, update, ct);
}
/// <summary>
/// Check user selected CV
/// </summary>
/// <param name="user"></param>
/// <param name="update"></param>
/// <param name="ct"></param>
private async Task OnAuthStage(GetUserResponse user, Update update, CancellationToken ct = default)
{
if (string.IsNullOrEmpty(user.CVUrl))
{
await prepareUserService.SelectCv(update, ct);
}
await menuService.RenderMenu(update, ct); //boilerplate await menuService.RenderMenu(update, ct); //boilerplate
} }
} }