For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customizable notifications in Telegram

If Suvvy's standard notifications don't suit you, you can set up notifications in your TG bot using the Webhooks mechanism.

To set up custom alerts for your Telegram bot, follow a few simple steps:

  1. Create a bot in BotFather.

You can find detailed instructions on how to create a bot in BotFather in the Telegram manual section.

  1. Get the chat id (chat_id) to which notification messages will be sent.

a. If you want to receive notifications in the bot, you must obtain your personal user_id, which will also be used as your chat_id in the future. You can learn how to obtain your personal user_id by following this link.

b. If you want to receive notifications in a group, you need to get the chat_id of the group to which notifications will be sent.

Instructions on how to get a group's chat_id.

Step 1: Add your bot to the group

  1. Open Telegram.

  2. Go to the desired group.

  3. Add your bot as a regular member.

  4. Assign it as an admin (if you want it to be able to post messages to the group).

Step 2: Write any message to the group

Anything—whether it's a "test" from yourself or something else entirely. This is necessary to get the group active.

Step 3: Get updates via the Telegram Bot API

  1. In your browser, enter the following URL:

https://api.telegram.org/bot<ТВОЙ_ТОКЕН>/getUpdates

Where <YOUR_TOKEN> is the token of your TG bot.

Example:

https://api.telegram.org/bot123456789:ABCDEF1234567890abcdef12345678/getUpdates
  1. The response will be JSON, which will contain something like:

{
"update_id": 123456789,
"message": {
"chat": {
"id": -1001234567890,
"title": "Название группы",
"type": "supergroup"
},
...
}
}

Step 4: Use the chat_id from the response

Here is this id:

-1001234567890

— and there's the group's chat_id. It's always negative.

  1. In Savvy, go to Workflows and click Add:

  1. Select Webhook from the list:

  1. Filling in the function fields

  1. Add arguments and constants that will be passed to the webhook:

Arguments are variables that the bot will generate during the conversation. They depend on the user's responses. Constants are parameters that will be passed to the webhook invariably. In our case, the bot name will always be passed to the webhook, such as "Bot - Elsa."

  1. Configure the Webhook step:

  1. We write the Request Body in JSON format:

Example:

❗️ Arguments in curly brackets must be replaced with arguments added through ➕.

  1. Click Save:

  1. Now that we've configured the Action to send a notification to our TG, we need to add instructions to the central prompt for the bot, telling it how to generate arguments and when to pass them to the webhook sending function.

In addition to arguments generated during the dialogue from the client's responses, the bot can pass parameters located in placeholders to the function.

Placeholder parameters can be found in the dialog export at the very top of the page. It looks like this:

Structuring Messages

If your notification text is quite long, it's best to set it up so that each line is on a new line to make the information easier to read. You can set up text wrapping for this purpose.

Settings

In the action, you need to add a Constant containing the line feed operator "\n".

Next, in the body of the request, before the first word of the phrase, which should be on a new line, you need to add a constant with a hyphenation operator.

After these actions, phrases that were preceded by the hyphenation operator will start on a new line.

Last updated