mirror of
https://github.com/Nezumi-2711/revanced-apk-build.git
synced 2026-09-22 20:02:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be1c20bb87 | ||
|
|
88a00ca413 |
+16
-25
@@ -174,35 +174,26 @@ jobs:
|
||||
${BODY}
|
||||
|
||||
**Download Links:**
|
||||
"
|
||||
|
||||
MODULES_MSG="
|
||||
**Modules:**
|
||||
${MODULES}
|
||||
"
|
||||
|
||||
APKS_MSG="
|
||||
**APKs:**
|
||||
${APKS}
|
||||
"
|
||||
|
||||
# Function to split messages properly by ensuring correct Markdown formatting
|
||||
send_discord_message() {
|
||||
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"
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \
|
||||
"$DISCORD_WEBHOOK_URL"
|
||||
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg content "$MODULES_MSG" '{content: $content}')" \
|
||||
"$DISCORD_WEBHOOK_URL"
|
||||
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg content "$APKS_MSG" '{content: $content}')" \
|
||||
"$DISCORD_WEBHOOK_URL"
|
||||
|
||||
Reference in New Issue
Block a user