Telegram Notifications

Telegram notifications are essential for informing administrators and users about changes in application statuses or other requests without the need to keep the exchange page open.

Settings

  1. In Telegram, send a message /newbot to @BotFather and follow the instructions to create a bot. After successfully creating the bot, a token will be displayed—copy it to your clipboard. No other bot settings need to be changed.

  2. In the website control panel (under the "Telegram" -> "Settings" section), enter the token you received during the bot creation in the "Token" field.

Section "Telegram" -> "Settings"

If the Telegram section does not appear in the sidebar, enable the module in the "Modules" section:

  1. If you need to log the bot's actions and view logs later in the "Telegram" -> "Message Log" section, activate the following options:

Section "Telegram" -> "Message Log"
  1. At the bottom of the "Telegram" -> "Settings" section, follow the link to register the webhook.

Section "Telegram" -> "Settings"
  1. If necessary, write the message texts for the bot users.

Section "Telegram" -> "Settings"
  1. In the "Users" section, in your user's profile, specify your Telegram username without the @ symbol (if the username is absent, it must be set in the Telegram settings).

Section "Settings" in Telegram
Section "Users" -> "Edit"
  1. Activate the bot by sending it the message /start in Telegram.

  2. In the "Messages" → "Telegram Templates" section, configure the necessary templates for various application statuses and other options for sending messages on behalf of the bot to administrators and users:

Section "Messages**" → "Telegram Templates"

Template settings:

  • Send: "Yes" — send messages, "No" — do not send.

  • Telegram username of the administrator (without @) — the administrator's username to which notifications will be sent. You can specify multiple usernames separated by commas if you have several administrators.

  • Text — the text of the message being sent. Above the text input field, you will find a panel with [shortcodes]. Use them in the message text and subject line to display data from the applications in the sent messages.

  1. To use the bot, you need to add an additional "Telegram" to each exchange direction that will use the bot.

Section "Exchange Directions" -> "Additional Fields"

This is necessary so that the exchange page displays a field for users to input their username.

Exchange page
  1. To use the bot, the exchange user can specify their Telegram username in their profile settings (it will automatically populate the "Telegram" field if it is present when creating an application—this set of fields is determined by the administrator for each direction individually) or manually enter their username when creating each application.

User's personal account in the exchange

By default, messages are not sent to administrators if the administrator changes the application status in the admin panel (in the "Applications" section) themselves. If you need messages to always be sent to the administrator, this option must be activated in the "Exchange Settings" -> "General Settings" -> "Other Settings" section, under "Send email to admin if admin changes application status."

Troubleshooting

Note for exchange administrators: Clients often forget to start the Telegram bot, which is why they do not receive notifications. To avoid this, it is recommended to add instructions in the Telegram notification template (for example, “New Application”): “To receive notifications about your application, please first go to our Telegram bot and click \Start.”. Without activating the bot using this button, Telegram does not allow sending messages from the bot to the client.

If users or administrators are not receiving messages from the bot or have stopped receiving them, check the "Telegram" -> "Message Log" section, where you can view all logs related to the bot's operation. If necessary, you can use the filter that shows which messages pertain to the bot itself and which are for the bot's users.

Section "Telegram" -> "Message Log"

If there are issues with sending messages via the bot, you can delete and re-register the webhook (see point 4)—this may help restore the bot's functionality.

If you are using Cloudflare or a similar service for your website, add Telegram IP addresses to the whitelist in your service:

91.108.56.0/22
91.108.4.0/22
91.108.8.0/22
91.108.16.0/22
91.108.12.0/22
149.154.160.0/20
91.105.192.0/23
91.108.20.0/22
185.76.151.0/24
2001:b28:f23d::/48
2001:b28:f23f::/48
2001:67c:4e8::/48
2001:b28:f23c::/48
2a0a:f280::/32

An alternative option is to add a pool of IP addresses by ASN (autonomous system number)—the ASN for Telegram and their addition to the whitelist in the Cloudflare account are detailed in the instructions.

Last updated