- Notifications
You must be signed in to change notification settings - Fork442
Pluggable Telegram bot and userbot based on Telethon
License
SpEcHiDe/UniBorg
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Pluggableasyncio
Telegram userbot based onTelethon.
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theMozilla Public License for more details.
- This was an attempt to learn userbot development using Telethon,this project is now no longer usable, and is FORKed and MODIFied to suit MY needs, souse at your own risk.
Install Docker by following theofficial docker docs
Start docker daemon [skip if already running]:
dockerd
- Build Docker image:
docker build. -t uniborg
- Run the image:
docker run uniborg
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 packagesmay conflict with the system package manager's installed packages, which cancause trouble down the road and errors when upgrading conflicting packages.You have been warned.
Simply clone the repository and run the main file:
git clone https://github.com/udf/uniborg.gitcd uniborgpython3 -m venv venv. ./venv/bin/activatepip install -r requirements.txtcp sample_config.env config.env# <edit config.env with appropriate values>python3 -m kopp
The core features offered by the customTelegramClient
live under theuniborg/
directory, with some utilities, enhancements, the_core
plugin, and the_inline_bot
plugin.
- Only five of the environment variables are mandatory.
- Please read theWiKi to understand the use of the variables.
- This is because of
telethon.errors.ApiIdPublishedFloodError
APP_ID
:API_HASH
:TG_BOT_TOKEN_BF_HER
:TG_BOT_USER_NAME_BF_HER
:DATABASE_URL
:
- The userbot should work without setting the non-mandatory environment variables.
The modular design of the project enhances your Telegram experiencethroughpluginswhich you can enable or disable on demand.
Each plugin gets theborg
,logger
,Config
magicalvariablesto ease their use. Thus creating a plugin as easy as addinga new file under the plugin directory to do the job:
# stdplugins/myplugin.py@borg.on(slitu.admin_cmd(pattern="hi"))asyncdefhandler(event):awaitevent.client.send_message(event.chat_id,"hey" )
Check out the already-mentionedplugins directory, or some third-partyplugins to learn how to write your own, and consider readingTelethon's documentation.
Thanks to:
About
Pluggable Telegram bot and userbot based on Telethon
Topics
Resources
License
Stars
Watchers
Forks
Packages0
Languages
- Python98.7%
- Other1.3%