Compare commits

...
3 Commits
14 ... 17
Author SHA1 Message Date
nezumi be1c20bb87 update config 2025-01-22 20:03:31 +07:00
nezumi 88a00ca413 update config 2025-01-22 19:41:27 +07:00
nezumi 788b36f083 update config 2025-01-22 19:24:00 +07:00
+16 -25
View File
@@ -174,35 +174,26 @@ jobs:
${BODY} ${BODY}
**Download Links:** **Download Links:**
"
MODULES_MSG="
**Modules:** **Modules:**
${MODULES} ${MODULES}
"
APKS_MSG="
**APKs:** **APKs:**
${APKS} ${APKS}
" "
# Function to split messages properly by ensuring correct Markdown formatting curl -X POST -H "Content-Type: application/json" \
send_discord_message() { -d "$(jq -n --arg content "$MSG" '{content: $content}')" \
local message="$1" "$DISCORD_WEBHOOK_URL"
local buffer=""
while IFS= read -r line || [ -n "$line" ]; do curl -X POST -H "Content-Type: application/json" \
# Check if adding the current line exceeds 2000 characters -d "$(jq -n --arg content "$MODULES_MSG" '{content: $content}')" \
if [ ${#buffer} -ge 2000 ]; then "$DISCORD_WEBHOOK_URL"
# Send the current buffer and reset it
curl -X POST -H "Content-Type: application/json" \ curl -X POST -H "Content-Type: application/json" \
-d "$(jq -n --arg content "$buffer" '{content: $content}')" \ -d "$(jq -n --arg content "$APKS_MSG" '{content: $content}')" \
"$DISCORD_WEBHOOK_URL" "$DISCORD_WEBHOOK_URL"
buffer=""
fi
buffer+="${line}\n"
done <<< "$message"
# Send any remaining content in the buffer
if [ -n "$buffer" ]; then
curl -X POST -H "Content-Type: application/json" \
-d "$(jq -n --arg content "$buffer" '{content: $content}')" \
"$DISCORD_WEBHOOK_URL"
fi
}
send_discord_message "$MSG"