Telegram Bot for Retrieval
Allow your clients to download their certificates after providing personal information.
The Telegram bot will request personal details, such as an email address or name, and provide files from the Disk that match the request. If multiple files match, all relevant files will be shared.
You can integrate Telegram by navigating to Integrations - Telegram Bot.
Integration Settings
-
Enable Telegram Bot.
This toggle turns the bot on or off. If an attempt is made to message a disabled bot, it will respond with "Bot is not operational".
-
Token
The token for accessing Telegram API. You must obtain this token when creating a new bot. After entering and saving the token, a confirmation message, "Bot successfully activated via Telegram API", should appear below the input field. This indicates the token is valid, and the bot has been successfully activated in Telegram.
Creating the Bot
First, you need to register a new bot with the "Bot Father" — @BotFather — to get the token for working with the Telegram API. The registration process involves a few simple steps:
- Open a chat with @BotFather on Telegram;
- Enter or select the command /newbot from the list;
- Send the desired name for your bot, for example, "New Era Olympiad";
- Then, specify a username for the bot, which will be used for searching. The username must end with the word "bot" or "_bot". For example, OlympNewTime_bot;
- You can write a description for the bot. Use the /setdescription command, choose your new bot, and write a message like the following:
Retrieve your diplomas and certificates for participating in the "New Era" Olympiad. Simply provide your first and last name. Your document will be sent in response. If no file is found, please verify the name entry or contact us. If other data is required instead of a name, make sure to mention it. - Optionally, configure a start command by sending /setcommands. Select your new bot and set the command "start - Launch". This will make the "Launch" button send the initial request when the bot is opened.
- You may also upload a bot logo using the /setuserpic command.
-
Messages
Messages to be sent by the bot and the parameters for data lookup. Two options are available: using one message or two messages.
Single Message
Use a single message to search for files. After receiving the data, the bot will perform a file search, and any files meeting the criteria will be sent to the user.
The simplest scenario involves requesting the full name. Write "Please provide your first and last name" in the "Message" field and assign the appropriate variable (e.g., %name) to "Variable 1." Another option is to search by surname only. In that case, choose "first word" in the search type, and the bot will search using just the first word of the variable. For emails, use %email.
Two Messages
For enhanced security, use two messages. The bot will share files only after both queries are satisfied.
For example, during file generation, you can include a password in the table. The bot will first ask for the password, followed by a name. If both credentials match, the bot will send the corresponding files. You can distribute passwords securely via private channels. They can remain uniform or vary for different events.
To add passwords to the table, include the %password variable in "Question 2." Then, in the document, click on the blank column, select the variable, and enter the password. This ensures links between passwords and files.
In both queries, personal data for each file can be requested, either embedded within the file or stored alongside it.
-
Search Type
Set the precision level for variable searches using the dropdown menu. Opt for "first word" searches, such as by surname, if the file information is incomplete (e.g., missing full names). If the bot asks for full names but the files have only partial data, the correct file may not be found. However, by selecting "first word" as the search type, the bot can request just the surname. To avoid sending incorrect data to users with the same surname, consider setting up searches with two parameters.
- File Access. Control access to files available through the bot. Specify multiple folders or select all files on the Disk. Files in subfolders will also be accessible if the parent folder is selected. Folder nesting depth does not matter.