Send a Telegram Message from Cron
To send a Telegram message from cron, call the Bot API sendMessage endpoint with curl. You need a bot token from @BotFather and your chat ID.
The command
Create a bot with @BotFather to get a token, and find your chat ID (send a message to the bot, then read https://api.telegram.org/bot<TOKEN>/getUpdates). Then:
0 8 * * * curl -s "https://api.telegram.org/bot<TOKEN>/sendMessage" -d chat_id=<CHAT_ID> -d text="Daily report ready"
Send a command's output
0 8 * * * curl -s "https://api.telegram.org/bot$TOKEN/sendMessage" -d chat_id=$CHAT_ID --data-urlencode text="$(/path/job.sh 2>&1)"
--data-urlencode handles spaces and newlines safely.
Keep secrets out of the crontab
Put TOKEN and CHAT_ID in a sourced file (. /path/.env) rather than inline, so the crontab isn't readable secrets.
FAQ
How do I send a Telegram message from cron?
Call the Bot API with curl: curl -s 'https://api.telegram.org/bot<TOKEN>/sendMessage' -d chat_id=<ID> -d text='...'. You need a bot token from @BotFather and your chat ID.
How do I find my Telegram chat ID?
Message your bot, then open https://api.telegram.org/bot<TOKEN>/getUpdates and read the chat.id field from the response.
How do I send multi-line output to Telegram?
Use --data-urlencode text="$(command 2>&1)" so spaces and newlines are encoded correctly.