Telegram bot notepad

Telegram bot notepad

Main
Client
Goals
Solution
Result
Additional

Or why it is convenient

Sometimes, there are too many names; the events are too intense for our monkey's brain. And in general, when you write an article, you will re-read more than a dozen articles related to the problem that you are considering in your article.

In such situations, when there is a lot of information, you need some kind of assistant who can unload and systematize the acquired knowledge. Such an assistant can be a simple notebook with a pen. But, however, after a couple of hours of work, such a notebook turns into an unreadable piece of paper.

I solved this problem by making a telegram bot and a notes' manager.

anonymous_1

This person contacted me via telegram and asked if I could make a notebook, but in a telegram via the telegram bot. He chose to remain in the shadows.

We don’t know each other, so I can’t tell you anything specific about him. The fact itself. The name is fictitious. As I mentioned earlier, he chose to remain in the shadows.

Goals

The bot must be able to add notes.

The bot must be able to delete notes.

The bot must be able to change notes.

The bot must be able to sort and find the necessary notes

Be accessible, that is, a telegram bot :)

Solution

How the telegram bot was made

First, I’ve taken my favorite Python framework for developing telegram bots, aiogram.

Secondly, I determine the structure of the database and where and in what form it will be stored. I decided to write my own database, which would be stored in JSON format on the server.

And at the end, I deployed the bot on VPS. If you are curious, the hoster of a VPS server is a beget company.

There were no difficulties during the development of the bot. Although the feature of editing notes introduced some flavor of complexity, my bot just operates in the database with notes.

It represents a Python dictionary. Editing single notes is simple. But editing categories or subcategories not so obvious. Or rather, it is not the editing itself that is difficult, but the fact of dividing the data into categories and notes. And their separate processing and display for users.

How I used it to remember what I read

I used the categories as the names of books read or being read. Subcategories mean the type of information stored.

I recently read “Azazel” by Boris Akunin, so I immediately compiled a list of the main characters. The subcategory is called heroes.

I also have a short category. I need it for a brief summary of the chapters in the book, just the gist.

Result

As a result, we have a telegram bot and a note manager. Which is deployed on VPS from beget. With the presence of the necessary functionality in the form:

search for notes.

adding notes.

delete notes.

changes to the notes.

And as a bonus, English localization has been added for English-speaking users. But this was my personal decision, because I prefer English interfaces out of habit.

Oh yes, that’s the name of the telegram bot, @NotebookOnMarginalia_bot

Additional materials

All translations were made using the Python module babel.

The note bot was developed with an eye toward expanding its further functionality, so stay tuned for updates.


heart 0
3 connected dots 0