Skip to content

My fork of uniborg, which is a pluggable Telegram bot and userbot based on Telethon. Gives you a Unix shell in Telegram!

License

Notifications You must be signed in to change notification settings

NightMachinery/betterborg

 
 

Repository files navigation

betterborg

The crust of this fork is the advanced_get plugin, which gives you a unix shell in Telegram, with the ability to exchange files. I’ll update the README when I have the time to document it.

Needs Python 3.7.2+.

llm-stt

borgdir=~/code/betterborg/
# set this the directory containing betterborg
##
tmuxnew () {
    tmux kill-session -t "$1" &> /dev/null
    tmux new -d -s "$@"
}

tmuxnew betterborg_stt "dash -c 'cd $(gq $borgdir) && borg_session=session_stt borg_plugin_path=stt_plugins borg_brish_count=1 $(gq "$(realpath2 python3)") $(gq $borgdir/stdborg.py)'"

llm-chat

borgdir=~/code/betterborg/
# set this the directory containing betterborg
##
tmuxnew () {
    tmux kill-session -t "$1" &> /dev/null
    tmux new -d -s "$@"
}

tmuxnew betterborg_llm_chat "dash -c 'cd $(gq $borgdir) && borg_session=session_llm_chat borg_plugin_path=llm_chat_plugins borg_brish_count=1 $(gq "$(realpath2 python3)") $(gq $borgdir/stdborg.py)'"

uniborg

Pluggable =asyncio= Telegram userbot based on Telethon.

installing

Simply clone the repository and run the main file:

sudo apt-get install -y coreutils fzf zsh python3

mkdir -p ~/code
cd ~/code

git clone 'https://github.com/NightMachinary/betterborg.git'
cd betterborg

pip3 install -r requirements.txt

python3 stdborg.py

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 and storage 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
from telethon import events

@borg.on(events.NewMessage(pattern='hi'))
async def handler(event):
    await event.reply('hey')

internals

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

learning

Check out the already-mentioned plugins directory to learn how to write your own, and consider reading Telethon’s documentation.

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%