SpEcHiDe / UniBorg

Pluggable Telegram bot and userbot based on Telethon
https://telegram.dog/UniBorg
Mozilla Public License 2.0
195 stars 446 forks source link
any download ffmpeg pluggable rename telegram-userbot telethon uniborg upload userbot

uniborg

Pluggable asyncio Telegram userbot based on Telethon.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public License for more details.

disclaimer

⚠️ This fork uses "requests" module in various places, instead of the async alternative. ⚠️

installing

The Easiest Way

It is not recommended to use "sudo", while using Docker. GNU/Linux Permissions are highly customisable, and it is generally not required to have "ROOT" permission, unless you know what you are doing. You can still install all the dependencies in your system [with ROOT permissions], but please be aware of the potential issues when doing so. The installed packages may conflict with the system package manager's installed packages, which can cause trouble down the road and errors when upgrading conflicting packages. You have been warned.

The Legacy Way

Simply clone the repository and run the main file:

git clone https://github.com/udf/uniborg.git
cd uniborg
python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
cp sample_config.env config.env
# <edit config.env with appropriate values>
python3 -m kopp

internals

The core features offered by the custom TelegramClient live under the uniborg/ directory, with some utilities, enhancements, the _core plugin, and the _inline_bot plugin.

design

The modular design of the project enhances your Telegram experience through plugins which you can enable or disable on demand.

Each plugin gets the borg, logger, Config magical variables to ease their use. Thus creating a plugin as easy as adding a new file under the plugin directory to do the job:

# stdplugins/myplugin.py
@borg.on(slitu.admin_cmd(pattern="hi"))
async def handler(event):
    await event.client.send_message(
        event.chat_id,
        "hey"
    )

learning

Check out the already-mentioned plugins directory, or some third-party plugins to learn how to write your own, and consider reading Telethon's documentation.

credits

Thanks to: