header.phone_number boris@borisbot.com

Draw bot

It registers participants, randomly selects a winner and publishes the results.

You need to log in to see the interactive example.

You need to log in to see the interactive example

This is a sample of the chatbot that helps conduct a draw with the selection of a random winner: it collects a database of participants, explain the rules, determine the winner, and publish the results. Additionally, you can set up verification of fulfillment of the draw conditions and selection of several winners.

You can use it for a draw on the website, Telegram, Instagram.

How does it work?
The bot is activated via a link, QR code or using a widget on the website  it depends on how you will attract participants to the draw. The bot can be launched in a browser or messenger.

The bot explains the rules and accompanies the participant. In this sample, you need to leave a review on the website and attach a screenshot. Accordingly, the bot sends a link to the resource and takes a screenshot.
Next, he finds out the participant’s name and assigns an individual number. All data is saved into a database table.
When the participant has registered, the bot sends a link to the Telegram group, where it will then publish the results of the draw. You can use another communication channel.

Next, you set the date of the draw, the bot selects a random winner on that day from the list of all participants and sends a message to the Telegram group with the winner’s name.
How to set up the bot?
1. Create a project in the designer, add this template, two scripts and a table will appear in your project.

2. Edit the scripts.
— The “Registration” script is needed to explain the rules of the draw and add participants to the list. Edit the texts in this script.
— The table is needed to save participants and set the date of the draw. Data is added to the table in the “Registration” script. If you edited this script, in the Table (Add Row) block, check that the cell values match the blocks. In the “Date” sheet, indicate the date of the draw in the dd.mm format, on this day the bot will select the winner.
— The “Winner Selection” script randomly selects a participant from the list. The first block is Table (Line Search) contains a condition under which the random selection script is launched when the date specified in the “Date” table arrives. The "Clock" icon is a graph by which the bot checks whether the desired date has arrived. In the current setup, the bot checks the date in the table daily at 12:00. If necessary, you can change the schedule. Please, note that the time zone is set automatically. In the same scenario, publication of results in a Telegram group is configured. Connect the messenger in the Settings section, create a group and get the group ID. How to do this - see here.

3. Test the bot.
— To do this, there must be at least two people in the “Participants” table. Run the “Registration” script using the link in Telegram and follow it to the end, and also ask a friend to do it.
— For the test, in the “Date” table, indicate the current date, in the “Selecting a winner” script, set the bot launch condition to “day”, the time — the next minute according to the current time, Moscow time. Click "Test". As a result, the group should receive a message with the results of the competition.

If you need to send the results to another messenger or email, use the newsletter. To do this, you need to create a User Segment and set up a Newsletter. You can also send results via SMS.

If you have any questions about setting it up yourself, write to the community on Telegram.