Telegram for notifications

Keep up-to-date with what your bot is currently doing

Setting up Telegram for notifications consists of multiple steps:

  • Creating a new Telegram bot with 'Botfather'

  • Placing the new bot's API token in StalexBot

  • Connecting the Telegram chat(s) you want to receive notifications in

1. Creating a new Telegram bot with 'Botfather'

a. Navigate to Botfather

In Telegram, look for the bot called 'Botfather'. This is the Telegram bot that allows you to create new bots yourself.

b. Creating the new bot

Talk to the Botfather, starting off with the command: /newbot. The bot will ask you a few questions to set it up.

2. Placing the new bot's API token in StalexBot

You received an API token like this from the Botfather:

12345678:AAHcjXvyTx-4FiMazWEBJSno1agMg1V_yV8

If you didn't do this already, navigate to Settings > Telegram Notifications in StalexBot.

Copy the code the Botfather gave you and paste it in the 'Telegram bot token' input on StalexBot.

3. Connecting the Telegram chat(s) you want to receive notifications in

After connecting the Telegram bot, you still need to decide which Telegram chats can receive notifications from your bot. You can connect the bot to private chats, but also to Telegram groups.

a. Connecting to a private chat

Now say something to the bot, it doesn't matter what, as long as you still have the 'Telegram Notifications' page open on StalexBot.

On StalexBot, click on 'Add chat':

After adding the chat, you can send a test message by clicking the 'Test message' button. This confirms the connection is set up. You will now receive notifications from the bot and can execute the commands like /positions, /monitor and /balance.

b. Connecting to a group chat

When creating a new group, choose to add the bot immediately, like so:

Next, we have to promote the bot the admin, so the bot can access messages in this group.

After promoting the bot to admin, type something in the group. Again, it does not matter what you type, as long as you have the 'Telegram Notifications' page open on your StalexBot.

Apply the same process as in step a to connect the group chat to StalexBot.

Last updated