From 070d2d19c368c72d0efc305d4c2ab46a6195e524 Mon Sep 17 00:00:00 2001 From: "Aleksanov, Yuriy" Date: Thu, 6 Mar 2025 12:05:17 +0300 Subject: [PATCH] msg2 --- my_msg.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/my_msg.cpp b/my_msg.cpp index 41bd390..28f6dfd 100644 --- a/my_msg.cpp +++ b/my_msg.cpp @@ -11,10 +11,6 @@ string bot_token; int my_msg(const string& msg) { cout << msg << endl; - if (bot_token.empty() || telegram_id.empty()) { - return 0; - } - CURL* curl = curl_easy_init(); if (!curl) return 6; @@ -52,12 +48,11 @@ int my_msg(const string& msg) { if (res != CURLE_OK) return 5; switch (http_code) { - case 200: return 0; - case 401: return 1; - case 400: return 2; - case 404: return 3; - default: - if (http_code >= 500) return 4; - return 4; + case 200: return 0; // Успех + case 401: return 1; // Неверный токен + case 400: return 2; // Неверный chat_id + case 404: return 3; // Неверный URL (бот не найден) + default: + return 4; // Ошибка сервера (500) } } \ No newline at end of file