Working in messengers
Checking Instagram subscription
check_insta_subscription()
Description
To check subscription to an Instagram account
check_insta_subscription()
Parameters: None
The function returns logical True if the user is subscribed to the account, False if not.
Working with WhatsApp
check_whatsapp() | get_whatsapp_bot_id_by_phone()
Description
The functions work if a WhatsApp bot is connected to a project.
To check whether a phone number has WhatsApp
check_whatsapp(phone_number) method to check whether WhatsApp is connected to the given phone number
Parameters: phone_number - phone number in the format 79999999999 or 89999999999
The function returns logical True if the number is registered in WhatsApp, False if it is not.
To get WhatsApp bot_id by phone number
get_whatsapp_bot_id_by_phone(bot_phone) function to find WhatsApp bot_id by phone number
Examples
Let’s check if WhatsApp is connected to a phone number:

Removing last message
last_message_id() | remove_last_message()
Description
last_message_id()- to get the number of the last bot's message
If both an image and text have been sent, the message numbers are separated by an underscore (_)
To correctly get the number of the bot’s last message, the message should be saved in the client dialog history.
This means that in a funnel block, message history saving should be enabled if sent via the funnel, or when sending a broadcast, the option "save message to dialog history" needs to be turned on.
remove_last_message() – to delete the bot's last message
It work only in Telegram and Facebook.
If the "Save to dialog history" toggle is enabled, then for Telegram and FB you can delete the last message via a mailing from a block. Simply use the function remove_last_message() in the calculator. This function removes the last message sent by the bot, but only if that message is saved in the dialog history.
Example
Example:
Create a broadcast block:

Customize the mailing settings as you like, then go to the "Sending" tab.
2. Activate the checkbox "Save mailing in the client dialog history" in the "Sending" tab:

Now, feel free to send the mailing.
If you want to delete the last message (for example, a message with an error), you can do so in a single block using the function remove_last_message().

Next, send the mailing with the function to delete the last message.
IMPORTANT! The last message cannot be deleted after some time!
Пример с получением ID последнего сообщения.

Pausing bot's operation
| pause_bot(minutes)
Description
pause_bot(minutes) - pauses bot’s operation for the specified number of minutes.
minutes - required parameter representing the number of minutes. It can be passed as either an integer or a decimal number.
The function works like clicking the "Pause" button in a client dialogue, but lets you specify the duration to pause the bot. It returns True upon successful execution.

Deleting planned messages
| delete_pended_messages_from_list(message_id_list, with_not_delete)
Description
delete_pended_messages_from_list(message_id_list, with_not_delete)
The function helps delete specific messages from the scheduled ones.
! message_id_list - required parameter; a list of blocks whose messages need to be deleted from the scheduled ones.
with_not_delete - optional parameter; deletes messages marked as "Do not delete." Any value can be passed to this parameter.
The return value "wrong message_id_list" appears if message_id_list is not provided or is not an array.
How to pass parameters:

Where to get the required parameter:

Checking the operator's status
| check_operator_status(email, with_pause)
Descriptiom
check_operator_status(email, with_pause) - checks whether the operator is on shift. Returns True if the operator is on shift, and False if not.
! email - required parameter; an employee's email
with_pause - optional parameter with values 1 or 0. If set to 1, the function returns a positive result when the operator’s status is either "On shift" or "On break." If set to 0, it returns a positive result only when the operator’s status is "On shift." Default value: 1.
Last updated
