Compare commits

...
4 Commits
11 ... 15
Author SHA1 Message Date
nezumi 788b36f083 update config 2025-01-22 19:24:00 +07:00
nezumi ae43197aa0 update config 2025-01-22 18:59:05 +07:00
nezumi c2fe93675e update config 2025-01-22 18:17:08 +07:00
nezumi aee01f1ca5 update config 2025-01-22 17:55:20 +07:00
+25 -3
View File
@@ -181,6 +181,28 @@ jobs:
${APKS} ${APKS}
" "
curl -X POST -H "Content-Type: application/json" \ # Function to split messages properly by ensuring correct Markdown formatting
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \ send_discord_message() {
"$DISCORD_WEBHOOK_URL" local message="$1"
local chunk=""
local remainder="$message"
while [ ${#remainder} -gt 0 ]; do
# Try to split at the last newline within the 2000-character limit
chunk="${remainder:0:2000}"
local cutoff=$(echo "$chunk" | awk 'END {print length($0) - length($NF)}') # Find last space/newline
if [ "$cutoff" -lt 2000 ]; then
chunk="${remainder:0:$cutoff}" # Safe chunk
remainder="${remainder:$cutoff}" # Remaining text
else
remainder="${remainder:2000}" # Fallback to default split
fi
# Send the chunk to Discord
curl -X POST -H "Content-Type: application/json" \
-d "$(jq -n --arg content "$chunk" '{content: $content}')" \
"$DISCORD_WEBHOOK_URL"
done
}
send_discord_message "$MSG"