Skip to content

Commit

Permalink
TG: Fix Markdown Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sushrut1101 <[email protected]>
  • Loading branch information
Sushrut1101 committed Mar 3, 2022
1 parent 198b1f2 commit c2e84df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
12 changes: 9 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ source vars.sh

# A Function to Send Posts to Telegram
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" -d chat_id="${TG_CHAT_ID}" \
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d text="$1"
}

Expand All @@ -30,7 +32,7 @@ if [ -f frameworks/base/core/xsd/vts/Android.mk ]; then
fi

# Send the Telegram Message
telegram_message \
printf \
"
🦊 OrangeFox Recovery CI
Expand All @@ -39,7 +41,11 @@ telegram_message \
📱 Device: ${DEVICE}
🌲 Logs: [https://cirrus-ci.com/build/${CIRRUS_BUILD_ID}](https://cirrus-ci.com/build/${CIRRUS_BUILD_ID})
🖥 Build System: ${FOX_BRANCH}
"
" > tg.md

TG_TEXT=$(< tg.md)

telegram_message $TG_TEXT
echo " "

# Prepare the Build Environment
Expand Down
4 changes: 3 additions & 1 deletion sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ cd ~

# A Function to Send Posts to Telegram
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" -d chat_id="${TG_CHAT_ID}" \
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d text="$1"
}

Expand Down
12 changes: 9 additions & 3 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ source vars.sh

# A Function to Send Posts to Telegram
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" -d chat_id="${TG_CHAT_ID}" \
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d text="$1"
}
Expand Down Expand Up @@ -49,7 +50,7 @@ echo "Mirror: ${MIRROR_LINK}" || { echo "WARNING: Failed to Mirror the Build!";
echo "=============================================="

# Send the Message on Telegram
telegram_message \
printf \
"
🦊 OrangeFox Recovery CI
Expand All @@ -60,7 +61,12 @@ telegram_message \
⬇️ Download Link: [${DL_LINK}](Here)
📅 Date: $(date +'%d %B %Y')
⏱ Time: $(date +"%T")
"
" > tg.md

TG_TEXT=$(< tg.md)

telegram_message $TG_TEXT

echo " "

# Exit
Expand Down

0 comments on commit c2e84df

Please sign in to comment.