Изменение текста сообщений и запросов к БД
Обновлён текст сообщения с "Панель администратора:" на "Панель администраторов:". Изменены условия фильтрации статуса отчетов в запросах к базе данных с 'Завершена' на 'закрыта'.
This commit is contained in:
parent
0ebb1a9c70
commit
4831a020e2
15
Program.cs
15
Program.cs
@ -31,7 +31,7 @@ class Program
|
|||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
_botToken = config["BotToken"] ?? throw new Exception("BotToken не найден в конфигурации!");
|
_botToken = config["BotToken"] ?? throw new Exception("BotToken не найден в конфигурации!");
|
||||||
Log.Information("Конфигурация успешно загружена.");
|
Log.Information("Конфигурация успешно загружена");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ class Program
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Настроим логирование
|
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.WriteTo.Console()
|
.WriteTo.Console()
|
||||||
.WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day)
|
.WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day)
|
||||||
@ -49,14 +49,15 @@ class Program
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Инициализация клиента бота
|
|
||||||
_botClient = new TelegramBotClient(_botToken);
|
_botClient = new TelegramBotClient(_botToken);
|
||||||
var me = await _botClient.GetMe(); // Добавили await для получения объекта User
|
var me = await _botClient.GetMe();
|
||||||
Log.Information($"Бот {me.FirstName} запущен! ID: {me.Id}");
|
Log.Information($"Бот {me.FirstName} запущен! ID: {me.Id}");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error($"Ошибка при подключении к Telegram API: {ex.Message}");
|
Log.Error($"Ошибка при подключении к Telegram API: {ex.Message}");
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,7 +392,7 @@ class Program
|
|||||||
|
|
||||||
await botClient.SendMessage(
|
await botClient.SendMessage(
|
||||||
chatId: chatId,
|
chatId: chatId,
|
||||||
text: "Панель администратора:",
|
text: "Панель администраторов:",
|
||||||
replyMarkup: keyboard
|
replyMarkup: keyboard
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -406,7 +407,7 @@ class Program
|
|||||||
{
|
{
|
||||||
await connection.OpenAsync();
|
await connection.OpenAsync();
|
||||||
var command = connection.CreateCommand();
|
var command = connection.CreateCommand();
|
||||||
command.CommandText = "SELECT Id, Description, Status FROM Reports WHERE Status != 'Завершена'";
|
command.CommandText = "SELECT Id, Description, Status FROM Reports WHERE Status != 'закрыта'";
|
||||||
|
|
||||||
var buttons = new List<InlineKeyboardButton[]>();
|
var buttons = new List<InlineKeyboardButton[]>();
|
||||||
|
|
||||||
@ -457,7 +458,7 @@ class Program
|
|||||||
{
|
{
|
||||||
await connection.OpenAsync();
|
await connection.OpenAsync();
|
||||||
var command = connection.CreateCommand();
|
var command = connection.CreateCommand();
|
||||||
command.CommandText = "SELECT Id, Description, Status FROM Reports WHERE Status = 'Завершена'";
|
command.CommandText = "SELECT Id, Description, Status FROM Reports WHERE Status = 'закрыта'";
|
||||||
|
|
||||||
var buttons = new List<InlineKeyboardButton[]>();
|
var buttons = new List<InlineKeyboardButton[]>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user