Dragon Userbot – expanding the capabilities of your Telegram account to a level limited only by your imagination

We want to talk about a project that has existed for more than a year and, over its history, has already received more than 200 “stars” on GitHub. ​Recently, we released version 4.0 – it uses new versions of libraries (Pyrogram) and has additional functionality.

The project is not commercial and does not contain any paid add-ons / functionality extensions.

Start

Our project began as an alternative to almost the only functional userbot that existed at that time – Friendly-Telegram (or FTG). It uses the telethon library – and we wanted to try, for the sake of experiment, writing the same thing under pyrogram. The choice of one library or another is a purely personal matter for everyone, but at that time, the team was inclined to choose Pyrogram. This is how Dragon-Userbot was born.

Team formation

After some time of semi-active development, the owner of the organization (John Phonk) decided to open the project to everyone by making the repository public. After a while, the project was noticed, and contributors began to join us. Of these, the core development team was later formed, which is responsible for repositories and module moderation.

Unique features

Our userbot has, perhaps, the best protection for users from malicious code.

First, the user cannot natively load modules that have not been approved by the developers (however, the user still has the ability to load untested modules by saving them directly to the file system).

Secondly, we block calls to the most dangerous methods – at the moment this is only DeleteAccountRequest, but the list will expand as the dangers / abuse of certain methods are reported.

In addition, the development team is almost constantly in touch with the user. We respond very quickly to Issues and Pull Requests, and provide support to users and developers of third-party modules in our Telegram chat.

We also try to make the user experience beautiful and seamless – we automate installation as much as possible, draw banners for updates and articles, use formatting in all core modules, etc.

In addition, we support two databases out of the box – SQLite and MongoDB, and use inheritance from the DataBase base class, which makes the ability to implement additional databases as simple as possible.

Why is all this

Besides the obvious features – automating many actions and modules just for fun, we have some really useful modules. We will now tell you about some of them:

  1. Safety
    Out of the box, the SessionKiller module is available. It “kills” all new sessions that have appeared in the account since the module was activated. In addition, it has a command that allows you to check active sessions in a convenient way. Yes, this option is available in the built-in Telegram client, but not all information is visible in it. For example, with our module you can see the last activity of a particular session, down to the second, see the Hash of the module and information about whether the APP_ID and APP_HASH are official for a particular application or just imitate them (of course, you can use the official ID and HASH to completely imitate the official application, but such attempts are often blocked by Telegram). We plan to add the ability to delete a session based on its hash.

  2. Chat administration
    The admintool module provides the widest range of options for chat administration. There is a unique opportunity to delete messages from a specific person without blocking this opportunity using Telegram. In addition, you can quickly clear the chat of deleted/blocked accounts and much more.

  3. View a list of channels and chats that you own/administer
    Thanks to the admlist module, you can get a list of chats and channels in which you are the owner or administrator. This feature is available in Telegram only when the limit of public links is overflowed, and then only chats with public links are visible.

  4. Convenience
    Userbot modules can send the same requests several times. The simplest example is when you need to delete a large number of messages (more than 100), Telegram will not allow you to do this. And using the purge module, you can delete as many messages as you want – the userbot itself will divide them into chunks of 100 pieces and send requests for deletion.

How can this be useful for business?

A common question for any Open-Source project is its usefulness beyond entertainment and personal purposes. Therefore, I would like to note that we were able to implement a fork of this project inside the company.

So, when a bug is reported (which comes to the developers’ chat), I can upload logs with a certain level for a specific service to the same chat with one command. In addition, we have implemented a project update on the server using one command in the chat, and the usage rights do not need to be changed separately in the bot each time – they are determined by the presence of administrative rights in this chat in the cart. This is easy to implement in a startup (when you don’t have very strict rules regarding who can deploy what and how), but, with some effort, can be implemented in a company of any size.
Works through integration with systemd and docker.

You can also modify the code so that it notifies a person about certain events. The most obvious usage pattern is to check the operation of a telegram bot, since we work on behalf of the user’s account. So, for example, you can implement a module that will send a message to the bot every minute, and, if there is no response, send a message to the developers’ chat. And also, if we take into account the previous point, you can immediately restart the unit / container so that everything rises (or not ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯).

In addition, there are many places in the code that can be used to assess the level of language proficiency of developers – which greatly simplifies the assessment of technical skills for employment.
This is a less obvious plus, but, nevertheless, a developer’s participation in OpenSource greatly affects his resume.

What if I need something that is not included in the modules out of the box?

No problem! With programming skills, you can write your own modules that will do exactly what you need. After this, if you wish, you can make the module available to everyone – simply by uploading it to our repository. We will check the module and, if it does not contain malicious code, we will publish it.

We already have a fairly large database of modules – for example, a module for Spotify (through which you can, among other things, control the player via Spotify Connect) or a module for LastFM (it itself finds and sends the track that is currently playing to the chat). In addition, there are simply beautiful modules – for example, an analogue of “hearts”, which was previously distributed obfuscated and with a session stealer.

How it works?

We use Pyrogram as the basis for the bot and load the modules in a rather clever way. You can view the code (or make changes) on our GitHub. We are constantly improving the module loading algorithm, working on error handling, etc. Also, almost all code is asynchronous.

I would like to note that the development of this project greatly improved our skills in searching for non-standard solutions and greatly improved our knowledge of Python architecture. Many places use the raw (RAW) Telegram API.

Installation

Officially, we only support Linux/MacOS, however, our project can also be installed on Windows. In this case, you should understand that some modules may stop working or work incorrectly.

WARNING:

We are not responsible for any consequences arising from the use of the project. Using automation tools on your account is contrary to the Telegram terms of service – you act at your own peril and risk.

Please note that using standard APP_ID and APP_HASH significantly increases the likelihood of blocking. We strongly recommend creating your own on the website https://my.telegram.org/ and using them.

In practice, the probability of a ban greatly depends on the “karma” of the account – first of all, it is influenced by the registration date (the older the account, the better) and previous blocking/restrictions (the lower, the better)

Results

I hope that you will find something for yourself from the story about the project. In fact, its possibilities are almost limitless.
We welcome feedback and user requests for modules – you can express your thoughts in the comments under this post and in our chats.
The project has been inactive for some time, but this has not affected its functionality as our team regularly makes the necessary changes.
Thanks for reading!

Our GitHub repository – https://github.com/Dragon-Userbot/Dragon-Userbot/
Links to all our chats and social networks are there.

Similar Posts

Leave a Reply

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