diff --git a/src/org/alx/commonFunctions.groovy b/src/org/alx/commonFunctions.groovy index 2911476..c639375 100644 --- a/src/org/alx/commonFunctions.groovy +++ b/src/org/alx/commonFunctions.groovy @@ -461,10 +461,8 @@ Boolean sendTelegramMessageViaBot(Map sendData, String botToken, String apiUrl = def (String httpUrl, String contentType) = [String.format('%s%s/sendMessage', apiUrl, botToken), 'application/json'] if (!sendData?.chat_id || !sendData?.text) return false Map telegramStatus = httpsPost(httpUrl, new JsonBuilder(sendData).toPrettyString(), contentType, contentType) - println String.format("bot token: %s", botToken) - if (debugOutput) - println String.format('Send data: %s\nResponse: %s', readableMap(sendData), - readableMap(telegramStatus)?.replace(botToken, hidePasswordString(botToken))) + outMsg(0, String.format('Telegram send data: %s\nResponse: %s', readableMap(sendData), + readableMap(telegramStatus)?.replace(botToken, hidePasswordString(botToken)))) Boolean telegramResponseOk = new JsonSlurper().parseText(telegramStatus?.response_content as String)?.get('ok') telegramStatus.response_status_line?.toString()?.contains('200 OK') && telegramResponseOk }