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:
Create a bot in BotFather.
You can find detailed instructions on how to create a bot in BotFather in the Telegram manual section.
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.
In Savvy, go to Workflows and click Add:

Select Webhook from the list:

Filling in the function fields

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


Configure the Webhook step:

We write the Request Body in JSON format:
Example:


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

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