From 123f52e912726909c729a6310c4bcaf1866200de Mon Sep 17 00:00:00 2001 From: Professional Date: Wed, 19 Mar 2025 23:21:03 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D1=83=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Program.cs b/Program.cs index b59a660..159f5b2 100644 --- a/Program.cs +++ b/Program.cs @@ -575,12 +575,12 @@ class Program string status = reader.GetString(2); string priority = reader.GetString(3); string statusEmoji = GetStatusEmoji(status); - string priorityMarker = priority.ToLower() == "высокий" ? "⚠️" : ""; + string priorityMarker = priority.ToLower() == "высокий" ? "⚠️ " : ""; buttons.Add(new[] { InlineKeyboardButton.WithCallbackData( - $"{priorityMarker} #{id} - {statusEmoji} {status} - {description}...", + $"{priorityMarker}#{id} - {statusEmoji} {status} - {description}...", $"report_{id}") }); } @@ -594,10 +594,10 @@ class Program }); await botClient.SendMessage( - chatId: chatId, - text: "Список заявок:", - replyMarkup: new InlineKeyboardMarkup(buttons) - ); + chatId: chatId, + text: "Список заявок:", + replyMarkup: new InlineKeyboardMarkup(buttons) +); } } catch (Exception ex) @@ -607,6 +607,8 @@ class Program } } + + private static async Task ViewArchivedReports(ITelegramBotClient botClient, long chatId) { string connectionString = "Data Source=bot.db"; @@ -630,12 +632,12 @@ class Program string status = reader.GetString(2); string priority = reader.GetString(3); string statusEmoji = GetStatusEmoji(status); - string priorityMarker = priority.ToLower() == "высокий" ? "⚠️" : ""; + string priorityMarker = priority.ToLower() == "высокий" ? "⚠️ " : ""; buttons.Add(new[] { InlineKeyboardButton.WithCallbackData( - $"{priorityMarker} #{id} - {statusEmoji} {status} - {description}...", + $"{priorityMarker}#{id} - {statusEmoji} {status} - {description}...", $"report_{id}") }); } @@ -649,16 +651,17 @@ class Program }); await botClient.SendMessage( - chatId: chatId, - text: "Архив заявок:", - replyMarkup: new InlineKeyboardMarkup(buttons) - ); + chatId: chatId, + text: "Архив заявок:", + replyMarkup: new InlineKeyboardMarkup(buttons) +); } } catch (Exception ex) { Log.Error($"Ошибка: {ex.Message}"); await botClient.SendMessage(chatId, "Ошибка при получении архива заявок"); + } } @@ -668,6 +671,8 @@ class Program + + private static async Task ShowReportDetails(ITelegramBotClient botClient, long chatId, long reportId, int messageId) { try