- Create a new Telegram bot:
- start a chat with BotFather;
- type
/newbot
, select a name (to be shown in chats) and handle for your bot; - note the bot token to access HTTP API - a long string with a colon in the middle (later referred to as
<token>
); - optionally
/setdescription
and/setuserpic
.
- Add the bot to the chat/channel and note its id:
- add the bot to a new or existing chat or group - this is where your bot will send notifications to;
- go to
https://api.telegram.org/bot<token>/getUpdates
(replace<token>
with your token); - within the
chat
part, find and note theid
field - a positive or negative number (later referred to as<chat_id>
).
- Programmatically send notifications: