Create a Telegram Bot and Get Chat ID
Create a Telegram Bot:
- Open Telegram and start a chat with
@BotFather. - Send
/newbot, follow the instructions, and record the bot token (e.g.,123456789:AAF...).

Obtain the Chat ID:
- Add the bot to a group or send it a direct message.
- Send a test message, then retrieve the chat ID using:
curl https://api.telegram.org/bot<your_bot_token>/getUpdates
- In the JSON response, find
"chat":{"id":<chat_id>}(e.g.,123456789or-123456789for groups). - Alternatively, use
@GetIDsBotto get the chat ID easily.
Test the Bot:
Send a manual test message to verify setup:
curl -X POST "https://api.telegram.org/bot<your_bot_token>/sendMessage" -d "chat_id=<your_chat_id>&text=Test message"