Created
February 15, 2026 23:59
-
-
Save zipizap/1c74ba85fb0d19832b26a54df0c32b44 to your computer and use it in GitHub Desktop.
tg_send_markdown.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -efu | |
| # set -x | |
| # Configuration | |
| BOT_TOKEN="YOUR_BOT_TOKEN_HERE" | |
| CHAT_ID="YOUR_CHAT_ID_HERE" | |
| # Ensure an argument is passed | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 \"*Bold Text* _Italic_\"" | |
| exit 1 | |
| fi | |
| MSG="$1" | |
| # Send via curl using legacy Markdown | |
| curl -s -X POST "https://api.telegram.org" \ | |
| -d chat_id="$CHAT_ID" \ | |
| -d text="$MSG" \ | |
| -d parse_mode="Markdown" > /dev/null | |
| if [ $? -eq 0 ]; then | |
| echo "Message sent successfully!" | |
| else | |
| echo "Failed to send message." | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
original was not ok, AI close-miss
Corrected bellow: