Bot in a Notepad – How I Wrote a Telegram Bot Builder for Humanities Students

If you've ever dreamed of creating your own Telegram bot, but were scared by the technical difficulties and the need to program or draw flowcharts, then I have great news for you. I present to you Bot in a Notepad — a Telegram bot constructor that I developed specifically for those who are far from the world of IT, but want to create their own bot quickly and easily. Unlike traditional constructors with flowcharts, I offer a more flexible and convenient way of working. Flowcharts can be complex and confusing, especially when the project gets big.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Bot dialogue created in notepad

Bot dialogue created in notepad

In this article, I will tell you how the idea of ​​creating a Bot in a notebook came about, what features and benefits it offers, and how you can start using it today. If you want to create your own Telegram bot, but don’t know where to start, or are looking for a way to simplify this process, this article is for you. In the future, I plan to publish articles with specific implementations for different areas, with examples and tips, so subscribe so you don’t miss out.

Idea

A year ago, while working on a Telegram bot for a client, I asked myself: “Is it possible to simplify the process of assembling typical dialogues in a bot and recording the result?” When working on projects, I often use a notepad for typing and Excel for sorting and visualization. Based on this experience, I decided that lists are quite a convenient option.

A bit of history

In 2017, after seeing a bot in Telegram, I was inspired by the idea of ​​chatbots. It seemed that this revival of an old technology would be successful and would facilitate many routine operations. Thus, a prototype of a CMS with the working name “Core4” was born. The main idea was to collect all bot interfaces to one core, regardless of the source of the message. The core had to accept, understand and process messages, giving a response in a form understandable to messengers.

The result was an MVP that works with the now banned Facebook, the departed Slack, Skype, Telegram, Viber, VKontakte, Yandex.Alice and even WeChat. All the bot's functions were divided into plugins with a single data exchange interface, which simplified the development and code. However, the blocking of Telegram in the Russian Federation and the increase in workload forced the idea to be put on the back burner.

Start

I wrote a plugin for Core4 that processes text wireframes and outputs quizzes in a bot. I started with a simple survey:

The third planet from the sun?
> Earth
> Venus
> Moon

Did you like the test?
> Yes
> no
What is your name?
Rate the difficulty of the test on a scale from 1 to 10?

Development

The task is not difficult, but I wanted more: branches, checks. The designer began to understand the types of questions and expected answers:

— «B» – waiting for a response by button
— «P:» — waiting for the phone via the «Share phone» button,
— «G:» — waiting for geolocation via the «Share geolocation» button,
— «#:» — waiting for contact to be sent or manual entry of phone number +7(495)123-45-67, + and at least 8 digits, brackets and separators are allowed
— «T:» — waiting for text input,
— «D:» — expect an integer or decimal number,
— «E:» — waiting for email input
— «U:» — waiting for URL
— «Y:» — waiting for date DD-MM-YYYY or date time DD-MM-YYYY HH:II
— «H:» — waiting for time input (hours and minutes) HH:MM
— «F:» — waiting for file sending,
— “X:” — any type of response (but not a button)

Added the ability to set a rating for a push-button answer (True/No) and award points for the answer. For branching, I came up with a simple option: “If you answered like this, ask a question.” I plan to add user segmentation based on answers (it already exists in the constructor, users are segmented, but it is not yet implemented in the framework).

After some modifications, the survey framework looked like this:

The third planet from the sun?
> Earth||Y10
> Venus||N
> Moon||N
Did you like the test?
> Yes||Y50
> no||N
> X: I'll tell you in a message|Describe your impressions in text, video or voice
T: What is your name?
D: Rate the difficulty of the test on a scale from 1 to 10?

The level of branching became almost unlimited, but difficulties in processing the algorithm appeared. Solving these issues took a lot of time, but in the end everything worked out.

We finish it with a file and sand it

In parallel, a web interface for post-processing the framework was written. Bot designers usually use flowcharts connected to each other with arrows, each block describes an action, each answer is assigned a variable, but this cannot be described in a notebook, so I chose a tree. A tree does not allow for complex connections, but for surveys it is logically much better, the entire survey scheme is visible and understandable, the capabilities of the tree allow you to easily move questions from level to level and change their places, in a block diagram everything is much more complicated.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Dialogue view in the designer

Not by text alone

You need to add pictures and multimedia to the questions, without this you can't make a beautiful quiz. I had to abandon the idea of ​​adding pictures in the framework, because any implementation would be impossible to explain to an unprepared user. I transferred it to the web constructor and the quizzes sparkled with new colors.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Editing the answer and question if this answer is selected

In the settings, there is an option to prohibit the repeated launch of the dialogue, for example, if it was a test to assess knowledge, when passing the quiz, the time spent on passing is measured, this will allow you to assess the speed and confidence of the respondent. In the plans – a time limit for passing.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Quiz settings

In the web interface, you can segment the user by responses, which will make it possible to send information at the intersection of segments. Segmentation is already working, and mailings are still in development

Full-time job

The web interface has a “Bot Keyboards” section, where you can create standard keyboards for navigation with quizzes connected to them, and you can also set messages when the keyboard is displayed. Using this feature, you can create complex transitions and variations. The designer is currently designed to work with quizzes, but there are plans to create familiar flowcharts with more convenient features.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

We create a keyboard and assign the actions of the buttons, the plans are to visualize everything on block diagrams

Communicating with users

Great! The quiz works, questions are asked, types are controlled, the bot will not accept the button for another answer, full control! And how to store the results? In the database, but each quiz is different in content and volume, so we store it in JSON. Tracking the results in the admin panel is nice, but not interesting. It would be nice to have the ability to immediately respond to the user. For example, we created a quiz dialogue on product support issues, the user selected his product, answered some questions, we received a request and … how to respond to him? How to ask clarifying questions without leaving Telegram? Let's create a closed forum in Telegram, add a bot there, give it rights to read messages and we have the ability to communicate with the user, and not just one of our employees can communicate, but everyone who is in a closed group (the user does not see it, he communicates with the bot)

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

This is how technical support or managers see requests, from where they can respond directly to the bot

We save and analyze

Communication via a bot is an important and necessary format, but we want to have a general picture, sort and filter the results. Google tables are what we need, but we do not create variables, and how then to record the results… We will do without variables! A little magic and everything works with tables, the first time you pass, a sheet with the maximum number of columns is generated (all answer options), each individual quiz is a separate sheet and nothing prevents us from creating several quizzes, everything will be clear and understandable. If the user gave the correct answer, we will highlight this cell in green, and the number of points for the answer will be shown in the note, this will make it possible to evaluate the results without being distracted by the description of the quiz, you do not need to remember the correct answers and you can immediately see where the error in the answers is.

Integration with Google Sheets allows you to create a service similar to Google Forms, but without settings and exiting Telegram.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Integration with Google Sheets. I like it! Do you?

We transfer the dialogue to CRM

In my work I use the Russian service YouGile https://ru.yougile.com/at one time I made a bot for publishing tasks from Telegram to the board, it is publicly available and free, called “YouGile unofficial bot”. Forwarded it a message, it published it on the board and, if necessary, sent a duplicate to your Email – convenient! And can quizzes be tasks? They can! I integrate quiz results with YouGile and it turns out – a simple and easy CRM! You can give a link to the quiz and its results will be immediately transferred to managers, after processing they will transfer them to the necessary columns, welcome to Agile-style

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

Processing requests in Kanban style

For those who don't want to connect anything

Just specify your email or Telegram account ID (must be subscribed to the bot) in the quiz settings, and receive copies of the dialogues in your email or messenger. It is difficult to answer from there, but not all tasks require an answer. A simple, useful and convenient function.

Bot in a Notepad — How I Wrote a Telegram Bot Builder for Humanities Website Builder, Chatbot, Quiz, Programming, Bot, Development, Earnings, Hobbies, HR Work, Survey, Google Sheets, Longpost

In this form, the result comes to email and Telegram

In this form, the result comes to email and Telegram

For the most advanced

Not enough options? Specify in the settings the address of your server on which you want to process quiz results yourself and immediately after the dialogue is completed, the bot will send you all the results in HTML and JSON format, prepare them in your own way or send them to another service. Useful!

Where to use?

— Creation of quizzes and surveys
— Technical customer support
— Decision tree (questions lead to the choice of a single result)
— Lead collection in CRM
— Evaluation of the quality of services, including use for mystery shoppers with report processing
— Subject knowledge tests
— Checkaps
— Collection of application forms in HR and creation of preliminary tests
— Employee onboarding
— Registration of participants for events with the possibility of discussing details and conducting via CRM
— Booking via quiz
— Drawing up a guest portrait
— Collection of meter readings
— Timekeeping and work progress reports
— Collection of applications for selection
— Collecting questions before/at the event
— Filling out applications for franchises, etc.
— Preparation of briefs and technical specifications with discussion and posting in CRM
— Applications for selection of premises
— Applications for calculation of catering costs
— Brief for calculating the cost of materials

A spoon of tar

The project is in the final testing stage, sometimes bugs appear, but in general everything works. The most annoying thing is the delay in processing the results when passing the quiz in the bot. This is because the product is young. A few seconds, but not pleasant, but bearable, this is a delay due to responses from external services, without connecting integrations it is not noticeable at all. And in the near future I will remake the handler and everything will fly =)

After replenishing the account, sometimes it kicks you out of the account and you need to log in again, this is a magical error, I'm looking for the reason. Well, of course, there are bugs that I don't know about, but you will definitely let me know =)

Big plans

Some of what was planned has already been partially implemented, some is still only on paper.

In the plans:
— Bot editor in the form of flowcharts, not quite the usual form, but it will be convenient
— Using variables to record answers with subsequent connection of a calculator (implemented by 50%)
— Mailings to segmented user groups with personalization
— Bot operation in groups and channels, subscription checking, moderation, publication of designed messages
— Support for message boards in forums (publication only via bot)
— Collecting bot statistics (statistics are already being collected, but not yet displayed)
— Connecting Core4 plugins will make it possible to use ready-made modules for typical solutions (it already works, quiz output and communication in the bot are part of the system plugins)
— Referral program for passive income (70%)
– and many many others

How to try

The working version is available on the website https://botpad.ru/landing/ You can edit or create a quiz on it.

You can see the result by creating your own dialogue using the link above or by using the one already filled out on the page. https://botpad.ru/landing/demo.php?q=11224

This is what the results look like in CRM YouGile

This is how managers see applications in a closed Telegram forum

This is how the results are displayed in Google Sheets

You can start working in the constructor on the page: https://botpad.ru/cp/

Subscribe to the telegram channel “Bot in a Notepad”to learn about the project's news and innovations, view cases and analyses.

Special love, respect and support to the first users!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *