Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbazhenoff committed Mar 16, 2024
1 parent 3f5734c commit 9ed4aae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/org/alx/commonFunctions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9ed4aae

Please sign in to comment.