# Working with links

## Links with click notification <a href="#dlya-raboty-s-ssylkami" id="dlya-raboty-s-ssylkami"></a>

proxy() | proxy\_date() | proxy\_timeout()

&#x20;<mark style="color:red;">**LEGEND:**</mark>

<mark style="color:red;">**!**</mark> - Required parameters

**proxy(lnk, one-shot)** - generates a link with click notification. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** -link \
**one-shot** -indicator that the link is one-time use. Simply pass the value 1.

**proxy\_date(lnk, date, time)** -  generates a link with click notification and a specified expiration time. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** - link\ <mark style="color:red;">!</mark> **date** - link expiration date \ <mark style="color:red;">!</mark> **time** - link expiration time\
**one-shot** - indicator that the link is one-time use. Simply pass 1.

**proxy\_timeout(lnk, minutes, one-shot)** - generates a link with click notification and a specified access timer. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** - link\ <mark style="color:red;">!</mark> **minutes** - the number of minutes the link remains active.\
**one-shot** - indicator that the link is one-time use. Simply pass 1.

<details>

<summary>Example</summary>

Let’s go through a simple example:

<div data-with-frame="true"><figure><img src="/files/xJqJcjhTlDU54BjjC0oq" alt=""><figcaption></figcaption></figure></div>

We've created two proxy links and inserted them into buttons and the message text. Since we're testing in Telegram, it's a good opportunity to recall how to format links properly using Markdown. To handle special characters, we've used the tg\_escape() function.

This is how the client sees them, for example, in Telegram:

<div data-with-frame="true"><figure><img src="/files/SpWF1iwX4lVWXOWvEx0u" alt="" width="188"><figcaption></figcaption></figure></div>

When the client clicks the link, we receive a callback:

<div data-with-frame="true"><figure><img src="/files/OxuepWOAbX3yAjJGnoTH" alt="" width="563"><figcaption></figcaption></figure></div>

Let's configure a response to this event:

<div data-with-frame="true"><figure><img src="/files/h7SlVhlGxGdh6u7ThKyU" alt="" width="563"><figcaption></figcaption></figure></div>

Now, let’s test the link removal functions:

<div data-with-frame="true"><figure><img src="/files/IE4cuhj9mpun1eIMkLbG" alt="" width="375"><figcaption></figcaption></figure></div>

Thus, if the client tries to use the one-time link after it has been deleted, they will receive an error because the link no longer exists.

Let’s delete the time-limited link:

<div data-with-frame="true"><figure><img src="/files/IE4cuhj9mpun1eIMkLbG" alt="" width="375"><figcaption></figcaption></figure></div>

After executing the function, no proxy links remain in the client card, and any attempt to follow the link returns the same error.

</details>

<details>

<summary>Code example for copying</summary>

Example code for the "Message" field (don’t forget to enable **Markdown** if you’re working with Telegram):

```
*Testing links:*
[Click](#{link3})
```

or test using the following output format:

<pre><code><strong>Testing links:
</strong>#{link2}
</code></pre>

Code example in the "Calculator" field:&#x20;

```
link1=proxy('https://mavibot.ai/', 1) 
link2=short_date('https://mavibot.ai/#tariff', '11.06.2025', '2pm') 
link3=tg_escape(link2)
```

</details>

{% hint style="info" %}
When a client clicks on a proxy link, you will receive a callback in the form **link\_was\_pressed** . This allows you to configure a reaction to the link click.

To do this, enter the received callback into the "Condition" field and set the matching type to Exact Match.
{% endhint %}

## Link shortening

short() | short\_date() | short\_timeout()

&#x20;<mark style="color:red;">**LEGEND:**</mark>

<mark style="color:red;">**!**</mark> - Required parameters

**short(lnk, one-shot)** - generates a link without click notification. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** -link \
**one-shot** -indicator that the link is one-time use. Simply pass the value 1.

**short\_date(lnk, date, time)** - generates a link without click notification and a specified expiration time. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** - link\ <mark style="color:red;">!</mark> **date** - link expiration date \ <mark style="color:red;">!</mark> **time** - link expiration time\
**one-shot** - indicator that the link is one-time use. Simply pass 1.

**short\_timeout(lnk, minutes, one-shot)** - generates a link without click notification and a specified access timer. The function takes the following parameters:\ <mark style="color:red;">!</mark> **link** - link\ <mark style="color:red;">!</mark> **minutes** - the number of minutes the link remains active.\
**one-shot** - indicator that the link is one-time use. Simply pass 1.

## **Link removal**

remove\_links() | remove\_one\_time\_links()| remove\_timer\_links()

<mark style="color:red;">**LEGEND:**</mark>

<mark style="color:red;">**!**</mark> - Required parameters

**remove\_links()** - deactivation of all shortened links sent to the client

\
**remove\_one\_time\_links()** - deactivation of all one-time links sent to the client<br>

**remove\_timer\_links()** - deactivation of all time-limited links sent to the client

## Telegram bot quiz link

quiz\_link\_timeout() | quiz\_link\_date() | quiz\_link()

{% hint style="warning" %}
Please note!

There is a 21-day limit on the validity of the link, so it must be refreshed!
{% endhint %}

To enable quiz display in Telegram, you need to:

1\. Copy a website page ID. To do this, go to the "Websites" section and select the desired website:

<div data-with-frame="true"><figure><img src="/files/XIBbpibhWOCNYRdhTCi4" alt="" width="563"><figcaption></figcaption></figure></div>

Further in the text, we will refer to **mini\_landing\_page\_id** as the variable name.

2\. In the "Calculator" field, use one of the following functions:

<mark style="color:red;">**LEGEND:**</mark>

<mark style="color:red;">**!**</mark> - Required parameters

**quiz\_link\_timeout(mini\_landing\_page\_id, minutes)  -** generates a link with a lifetime limit set in minutes

Parameters:

<mark style="color:red;">**!**</mark>**&#x20;mini\_landing\_page\_id** - website page ID\
**minutes -** link lifetime in minutes (type: number)

**quiz\_link\_date(mini\_landing\_page\_id, date, time) -** generates a link with an expiration limited to a specific date and time

Parameters:

<mark style="color:red;">**!**</mark>**&#x20;mini\_landing\_page\_id** - website page ID\
**date** - link active date (format: dd.mm.yyyy)\
**time** - link active time (format: hh:mm)

&#x20;**quiz\_link(mini\_landing\_page\_id)** - generates a link with no expiration time

Parameters:

<mark style="color:red;">**!**</mark>**&#x20;mini\_landing\_page\_id** - website page ID

<details>

<summary>Example</summary>

<div data-with-frame="true"><figure><img src="/files/DA4l0FGZ6UIOI4XtFNy9" alt="" width="563"><figcaption></figcaption></figure></div>

3\. Create a **Telegram Web App** button and specify the variable name in curly braces with a hash symbol.

<div data-with-frame="true"><figure><img src="/files/RYfjzSCNaiCLNR6wCk4v" alt="" width="375"><figcaption></figcaption></figure></div>

<mark style="color:red;">**Important!**</mark> \
Make sure the variable value is correctly saved in the advanced settings.

<div data-with-frame="true"><figure><img src="/files/pADyARbbidnZXtU7Gyuv" alt="" width="563"><figcaption></figcaption></figure></div>

If you use **quiz\_link\_timeout** to redirect a client to a website page, you can use client variables within the page title and description. For example, if the client has a variable **name** with the value "John", and the page description includes **"Hi #{name}, how are you?"**, the output will be "Hi John, how are you?". However, if the client does not have that variable, the value will be pulled from the project's global variables.

{% hint style="warning" %}
**Note!** Be careful when using links without an expiration time. If the link is shared with someone else and they complete the quiz, the results will be recorded under the client for whom the link was originally generated.
{% endhint %}

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/chatbot/functions/calculator/links.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
