пробуем

This commit is contained in:
Professional 2025-03-19 23:21:03 +07:00
parent 749e808be5
commit 123f52e912

View File

@ -575,12 +575,12 @@ class Program
string status = reader.GetString(2); string status = reader.GetString(2);
string priority = reader.GetString(3); string priority = reader.GetString(3);
string statusEmoji = GetStatusEmoji(status); string statusEmoji = GetStatusEmoji(status);
string priorityMarker = priority.ToLower() == "высокий" ? "⚠️" : ""; string priorityMarker = priority.ToLower() == "высокий" ? "⚠️ " : "";
buttons.Add(new[] buttons.Add(new[]
{ {
InlineKeyboardButton.WithCallbackData( InlineKeyboardButton.WithCallbackData(
$"{priorityMarker} #{id} - {statusEmoji} {status} - {description}...", $"{priorityMarker}#{id} - {statusEmoji} {status} - {description}...",
$"report_{id}") $"report_{id}")
}); });
} }
@ -597,7 +597,7 @@ class Program
chatId: chatId, chatId: chatId,
text: "Список заявок:", text: "Список заявок:",
replyMarkup: new InlineKeyboardMarkup(buttons) replyMarkup: new InlineKeyboardMarkup(buttons)
); );
} }
} }
catch (Exception ex) catch (Exception ex)
@ -607,6 +607,8 @@ class Program
} }
} }
private static async Task ViewArchivedReports(ITelegramBotClient botClient, long chatId) private static async Task ViewArchivedReports(ITelegramBotClient botClient, long chatId)
{ {
string connectionString = "Data Source=bot.db"; string connectionString = "Data Source=bot.db";
@ -630,12 +632,12 @@ class Program
string status = reader.GetString(2); string status = reader.GetString(2);
string priority = reader.GetString(3); string priority = reader.GetString(3);
string statusEmoji = GetStatusEmoji(status); string statusEmoji = GetStatusEmoji(status);
string priorityMarker = priority.ToLower() == "высокий" ? "⚠️" : ""; string priorityMarker = priority.ToLower() == "высокий" ? "⚠️ " : "";
buttons.Add(new[] buttons.Add(new[]
{ {
InlineKeyboardButton.WithCallbackData( InlineKeyboardButton.WithCallbackData(
$"{priorityMarker} #{id} - {statusEmoji} {status} - {description}...", $"{priorityMarker}#{id} - {statusEmoji} {status} - {description}...",
$"report_{id}") $"report_{id}")
}); });
} }
@ -652,13 +654,14 @@ class Program
chatId: chatId, chatId: chatId,
text: "Архив заявок:", text: "Архив заявок:",
replyMarkup: new InlineKeyboardMarkup(buttons) replyMarkup: new InlineKeyboardMarkup(buttons)
); );
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error($"Ошибка: {ex.Message}"); Log.Error($"Ошибка: {ex.Message}");
await botClient.SendMessage(chatId, "Ошибка при получении архива заявок"); await botClient.SendMessage(chatId, "Ошибка при получении архива заявок");
} }
} }
@ -668,6 +671,8 @@ class Program
private static async Task ShowReportDetails(ITelegramBotClient botClient, long chatId, long reportId, int messageId) private static async Task ShowReportDetails(ITelegramBotClient botClient, long chatId, long reportId, int messageId)
{ {
try try