diff --git a/Program.cs b/Program.cs index 0c004e4..e910218 100644 --- a/Program.cs +++ b/Program.cs @@ -129,7 +129,16 @@ class Program usersWaitingForReport[chatId] = true; userReportSteps[chatId] = 1; userReports[chatId] = new Report(); - await botClient.SendMessage(chatId, "Пожалуйста, укажите приоритет (низкий, средний, высокий)."); + var priorityKeyboard = new InlineKeyboardMarkup(new[] + { + new[] + { + InlineKeyboardButton.WithCallbackData("Низкий", "priority_low"), + InlineKeyboardButton.WithCallbackData("Средний", "priority_medium"), + InlineKeyboardButton.WithCallbackData("Высокий", "priority_high") + } + }); + await botClient.SendMessage(chatId, "Пожалуйста, выберите приоритет:", replyMarkup: priorityKeyboard); Log.Information($"Пользователь {chatId} начал создание заявки"); } else if (data == "admin_panel") @@ -226,6 +235,13 @@ class Program { await SendMainMenu(botClient, chatId); } + else if (data != null && data.StartsWith("priority_")) + { + string priority = data.Substring(9); + userReports[chatId].Priority = priority; + userReportSteps[chatId] = 2; + await botClient.SendMessage(chatId, "Пожалуйста, укажите кабинет."); + } } } @@ -292,11 +308,6 @@ class Program { switch (step) { - case 1: - userReports[message.Chat.Id].Priority = message.Text; - userReportSteps[message.Chat.Id] = 2; - await botClient.SendMessage(message.Chat.Id, "Пожалуйста, укажите кабинет."); - break; case 2: userReports[message.Chat.Id].Room = message.Text; userReportSteps[message.Chat.Id] = 3; @@ -337,6 +348,8 @@ class Program + + private static async Task DeleteReport(ITelegramBotClient botClient, long chatId, long reportId) { try