chore: some refactors
This commit is contained in:
@@ -6,13 +6,17 @@ namespace JOBot.TClient.Commands;
|
||||
|
||||
public class StartCommand(ITelegramBotClient bot, UserService userService) : ITelegramCommand
|
||||
{
|
||||
private const string ReturnMessage = "Привет! Я JOBot, помощник по поиску работы в IT.";
|
||||
public async Task ExecuteAsync(Update update, CancellationToken ct)
|
||||
{
|
||||
var isRegistered = await userService.RegisterAsync(
|
||||
update.Message?.Chat.Id ?? throw new Exception("Chat id is null"),
|
||||
await userService.RegisterAsync(
|
||||
update.Message!.Chat.Id,
|
||||
update.Message.Chat.Username);
|
||||
|
||||
await bot.SendMessage(chatId: update.Message.Chat.Id,
|
||||
isRegistered ? "You registered" : "Not registered", cancellationToken: ct);
|
||||
"Продолжая, вы принимаете политику конфиденциальности и правила сервиса" +
|
||||
"\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);
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="appsettings.json">
|
||||
<None Update="appsettings.Example.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"TelegramToken": "7372524570:AAGLW5dXhW5Jd78i9Zguyga-5gfeSF9KU4I",
|
||||
"BackendHost": "http://localhost:5001"
|
||||
}
|
||||
4
JOBot.TClient/appsettings.Example.json
Normal file
4
JOBot.TClient/appsettings.Example.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"TelegramToken": "TOKEN:HERE",
|
||||
"BackendHost": "http://localhost:5001"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"TelegramToken": "7372524570:AAGLW5dXhW5Jd78i9Zguyga-5gfeSF9KU4I",
|
||||
"BackendHost": "http://localhost:5001"
|
||||
}
|
||||
Reference in New Issue
Block a user