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.
Botfather in Telegram

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.
Once you complete the steps, you will receive the HTTP API token.

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.
After pasting it in, hit 'Save token'
Your Telegram bot will now be connected to StalexBot. There is one more step to go.

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

Click on this link to enter a chat with the bot you just created. Don't forget to hit 'Start' afterwards.
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':
You should see your account here. Click add to connect this 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:
Click on the bot, it will be added to the group immediately
Next, we have to promote the bot the admin, so the bot can access messages in this group.
Promote the bot the admin
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.