Telegram bot “Constitution of the Russian Federation”

Hello everyone! Half a year ago, I came across a video by Artemy Lebedev, in which he reviewed his work related to the constitution website.

The project is interesting and useful, but the implementation of the bot left me extremely disappointed.

Having extensive experience in developing Telegram bots, I would like to show my solution, how I see the implementation of a bot on this topic.

Bot of Lebedev Studio – https://t.me/constitutionforyou_bot

My bot – https://t.me/ru_constitution_bot

Preface

I would like to thank the Lebedev Studio team in advance for the work they have done. I have a good opinion of Artemy's work and consider him a high-level specialist.

I don't want to insult the team that worked on this project in any way. I just want to express my opinion and show a solution that, in my opinion, looks more practical, interesting and informative.

Let's start with the little things

When we follow the link, we see that the bot name does not contain any specifics, there is no profile description + there is no message in the block at the top of the chat.

The description in the profile and the name are displayed in the Telegram bot mention when clicking on the link and in the message when sending. Without this information, users who receive the link will not understand where it leads!

And the message at the beginning of the chat is used to briefly describe the rules of the bot.

Bot of Artemy Lebedev Studio. Profile description

Bot of Artemy Lebedev Studio. Profile description

In my decision, I provided a short description, changed the name to “Constitution of the Russian Federation” and changed the profile description.

My Bot. Profile Description

My Bot. Profile Description

/start command handler

Now let's send the command /startThere are several ugly moments here.

Firstly, the command text is not deleted and continues to clutter the chat. Later, this is also observed when sending commands when using the keyboard.

Secondly, you are sent a message saying “Hello” and a link to your profile. I don't remember what informational value this message has, which for some reason refers to a message with a command.

Most likely, this message was sent to display the keyboard, because without text the keyboard cannot be sent.

Then why not write a normal greeting message? Strange…

Bot of Artemy Lebedev Studio. Sending start command

Bot of Artemy Lebedev Studio. Sending start command

Look how I handled the start button click

  1. The team is removed and does not clutter the chat.

  2. The welcome message describes the bot sections and gives a brief understanding of how to work with the bot and what functionality it has.

My bot. Sending start command

My bot. Sending start command

A little about the functionality

I thought that simply listing articles was boring, so I decided to add some additional functionality to my bot.

My solution includes the ability to mark articles you've read and add them to the “Favorites” section.

My Bot. Articles

My Bot. Articles

For all my bots, I develop an admin panel with which you can add content, view analytics and information about users who interacted with the bot.

For the constitution bot, I also connected an administrative panel in which you can edit articles and chapters of the constitution.

My Bot. Admin Panel

My Bot. Admin Panel

About the basic functionality and structure of the project

The bot presented by Artemy Lebedev Studio sends new messages to the chat when interacting with buttons. At the same time, most of the message is occupied by an image, which is extremely inconvenient when working from a phone.

Bot of Artemy Lebedev Studio. List of articles

Bot of Artemy Lebedev Studio. List of articles

In my case, the first screen consists of buttons for going to important sections, so we go to the “articles” section. From the section with articles, I removed the image, got rid of the word “article” in the names of the buttons and added the status of reading the article + arranged the buttons 4 in a row.

My approach allowed me to make the messages more compact without losing their information content.

My Bot. List of Articles

My Bot. List of Articles

On the article page I added buttons to change the status “Read” and add to favorites. Navigation buttons were also added to navigate to other articles.

The article points were combined into one article to avoid increasing the navigation nesting.

My Bot. Article Message

My Bot. Article Message

The bot from Lebedev Studio does not have navigation within the article, so to go to a new article you need to go back a few steps.

Moreover, all transitions are accompanied by incomprehensible jumps, which after 5-6 times start to become wildly annoying.

This is due to the fact that their functionality is built on deleting and then sending new messages.

With this approach, if you open the bot via your phone and you have one message left, the bot simply closes… and this is much more annoying!

And if they used the method editMessageTextthen we would get smooth transitions between sections.

And for dessert!

  • The Menu button is active, but due to the small number of commands it is essentially useless

  • There are pictures in the articles, but they link to telegraph. I would understand if you were pulling traffic to the site, but otherwise… Why is this? It's not clear!

  • There is no handler for the /help command that could describe the bot's functionality!

Summary

Overall, in my opinion it is very weak, and you write your opinion in the comments!

It took me 3 days to implement my solution.

Of this time, I spent:

  • 1 day to write a parser to get information

  • 1 day to set up a simple admin panel on Laravel, for editing records

  • 1 day to write the bot functionality

Thank you for your attention, I hope this material was useful or at least interesting.

Bye everyone!

P.S.

This is not a commercial project! The sources of my bot are here…
https://github.com/prog-time/rf-constitution-bot

The bot was developed for presentation purposes only and will most likely not be supported in the future.

I am not responsible for the relevance of the articles of the constitution!

Similar Posts

Leave a Reply

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