Skip to content

Telegram Setup

Russell Thomas edited this page Apr 12, 2022 · 1 revision

In order to send yourself a message via Telegram you need to do 3 things. Create a bot, get your chat id, start a chat with that bot.

Step 1: Set up your bot All Telegram bots have global visibility. This is important when setting the name for your bot. I have several bot, so I name them myusername_botname. This makes it so my bots all have similar names.

In order to set up a bot, you need to start a chat with @botfather. Send the message /newbot and the BotFather will walk you though setting up your new bot. This is what a typical conversation will look like:

[2:21:03 PM] Russell: /newbot

[2:21:03 PM] BotFather: Alright, a new bot. How are we going to call it? Please choose a name for your bot.

[2:21:08 PM] Russell: test_123456

[2:21:07 PM] BotFather: Good. Now let's choose a username for your bot. It must end in bot. Like this, for example: TetrisBot or tetris_bot.

[2:21:26 PM] Russell: test_123456_bot

[2:21:25 PM] BotFather: Done! Congratulations on your new bot. You will find it at telegram.me/test_123456_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.

Use this token to access the HTTP API: 102932392:AAGjexEEZBJ3D09ubEb57zAAhq_qF8MDEI

For a description of the Bot API, see this page: https://core.telegram.org/bots/api Congratulations, you have created a bot! Make sure you save the access token (i.e. api key)! You will need it to create requests.

Step 2: Get your chat id To get your chat id you will need to start a chat with @idbot, and send the message /getid. The chat id will be a number like 394882049.

Step 3: Start chat with your new bot This is easy. Just start a new chat with @your_bot_name. This is necessary, though, or your bot will be unable to send messages to you.

Step 4: use your token and destination ID and fill in your application configuration section:

key="BotToken" value="12345"

key="DestinationID" value="1234"

Clone this wiki locally