Skip to content

Commit

Permalink
TG: Switch to HTML 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 3820f8c commit dd57abf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
14 changes: 7 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source config.sh
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d parse_mode="HTML" \
-d text="$1"
}

Expand All @@ -33,17 +33,17 @@ fi

# Send the Telegram Message
printf \
"
'
🦊 OrangeFox Recovery CI
βœ”οΈ The Build has been Triggered!
πŸ“± 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
πŸ“± Device: "'"${DEVICE}"'"
🌲 Logs: <a href="'"https://cirrus-ci.com/build/${CIRRUS_BUILD_ID}"'">"'"https://cirrus-ci.com/build/${CIRRUS_BUILD_ID}"'"</a>
πŸ–₯ Build System: "'"${FOX_BRANCH}"'"
' > tg.html

TG_TEXT=$(< tg.md)
TG_TEXT=$(< tg.html)

telegram_message "${TG_TEXT}"
echo " "
Expand Down
2 changes: 1 addition & 1 deletion sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd ~
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d parse_mode="HTML" \
-d text="$1"
}

Expand Down
21 changes: 12 additions & 9 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source config.sh
telegram_message() {
curl -s -X POST "https://api.telegram.org/bot${TG_TOKEN}/sendMessage" \
-d chat_id="${TG_CHAT_ID}" \
-d parse_mode="Markdown" \
-d parse_mode="HTML" \
-d text="$1"
}

Expand Down Expand Up @@ -49,21 +49,24 @@ echo "Download Link: ${DL_LINK}" || { echo "ERROR: Failed to Upload the Build!";
echo "Mirror: ${MIRROR_LINK}" || { echo "WARNING: Failed to Mirror the Build!"; }
echo "=============================================="

DATE_L=$(date +%d\ %B\ %Y)
DATE_S=$(date +"%T")

# Send the Message on Telegram
printf \
"
'
🦊 OrangeFox Recovery CI
βœ… Build Completed Successfully!
πŸ“± Device: ${DEVICE}
πŸ–₯ Build System: ${FOX_BRANCH}
⬇️ Download Link: [${DL_LINK}](Here)
πŸ“… Date: $(date +'%d %B %Y')
⏱ Time: $(date +"%T")
" > tg.md
πŸ“± Device: "'"${DEVICE}"'"
πŸ–₯ Build System: "'"${FOX_BRANCH}"'"
⬇️ Download Link: <a href="'"${DL_LINK}"'">Here</a>
πŸ“… Date: "'"$(date +%d\ %B\ %Y)"'"
⏱ Time: "'"$(date +%T)"'"
' > tg.html

TG_TEXT=$(< tg.md)
TG_TEXT=$(< tg.html)

telegram_message "$TG_TEXT"

Expand Down

0 comments on commit dd57abf

Please sign in to comment.