• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A clean selfbot for Telegram with an emphasis on quality and practicality, designed to complement the official clients.

Pyrobud

Latest tag CI status Telegram chat

Pyrobud is a clean selfbot for Telegram with an emphasis on quality and practicality.

It's designed to complement the official clients rather than replace them as many other selfbots tend to lean towards. It is written in Python using the Telethon library.

A working installation of Python 3.6 or newer is required to run Pyrobud.

Compatibility

Pyrobud should be compatible with all major operating systems. While it has not been officially tested on Windows or macOS, there should not be anything preventing it from working on those platforms. Please let me know if you've gotten it working so I can add it here.

It is also possible to run the bot on a smartphone. On Android it can be done with the Termux app, and on iOS it should be possible using the iSH app.

Installation

Native dependencies

Pyrobud uses the native LevelDB library for its database, so you'll need to install that first. Below are instructions for some common operating systems:

OS/Distro Command
Arch Linux pacman -S leveldb
Ubuntu apt install libleveldb-dev
macOS brew install leveldb
Termux apt install leveldb
FreeBSD pkg install leveldb

Using Docker

Simply run docker run --rm -itv "$PWD/data:/data" kdrag0n/pyrobud to run the latest unstable version with the data directory set to data in the current working directory. Feel free to customize the data directory as you wish, as long as you create config.toml in your chosen data directory using the instructions below. The data section of the Docker command should always look like -v "/path/to/data:/data".

Note that the official Docker image only supports Linux x86_64. Other operating systems and architectures are not supported. However, pull requests contributing such support are welcome.

Using pip

When using pip, it's highly recommended to install everything inside a virtual environment to minimize contamination of the system Python install, since many of the bot's dependencies are not typically packaged by Linux distributions. Such environments can easily be created using the following command: python3 -m venv [target directory]

They can then be activated using source [target directory]/bin/activate or the equivalent command and script for your shell of choice.

You can still install all the dependencies in your system Python environment, 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.

Stable

You can obtain the latest stable version from PyPI:

python3 -m pip install pyrobud

If are able to install libffi and OpenSSL development headers, installing the fast variant is highly recommended:

python3 -m pip install pyrobud[fast]

The native dependencies can be installed on Ubuntu with the following command:

apt install libffi-dev libssl-dev

You will need to find the corresponding packages on your OS or distribution of choice in order for the fast variant to install successfully.

Without the fast variant's cryptg encryption accelerator, the bot will be extremely slow when dealing with any files โ€” even small ones. Download and upload speeds can be as slow as kilobytes per second without it.

Bleeding-edge

First, clone this Git repository locally: git clone https://github.com/kdrag0n/pyrobud

After that, you can run python3 -m pip install . to install the bot along with the bare minimum dependencies. However, including the fast extras is highly recommended to improve performance: python3 -m pip install .[fast]

Read the section above for more information on what fast does and why you should use it.

Once it's installed, you can choose to invoke it using the pyrobud command, or run the bot in-place (which is described later in the Usage section). Running it in-place is recommended to allow for automatic updates via Git.

Error: Directory '.' is not installable. File 'setup.py' not found.

This common error is caused by an outdated version of pip. We use the Poetry package manager to make things easier to maintain, which works with pip through PEP-517. This is a relatively new standard, so a newer version of pip is necessary to make it work.

Upgrade to pip 19 to fix this issue: pip3 install -U pip

Configuration

Copy config.example.toml to config.toml and edit the settings as desired. Each and every setting is documented by the comments above it.

Obtain the API ID and hash from Telegram's website. TREAT THESE SECRETS LIKE A PASSWORD!

Configuration must be complete before starting the bot for the first time for it to work properly.

Usage

To start the bot, type python3 main.py if you are running it in-place or use command corresponding to your chosen installation method above.

When asked for your phone number, it is important that you type out the full phone number of your account, including the country code, without any symbols such as spaces, hyphens, pluses, or parentheses. For example, the US number +1 (234) 567-8910 would be entered as 12345678910. Any other format will be rejected by Telegram.

After the bot has started, you can run the help command to view all the available commands and modules. This can be done anywhere on Telegram as long as you prepend the command prefix to the name of the command you wish to invoke. The default prefix (if you haven't changed it in the config) is ., so one would type .help to run the command. All other commands work the same way, save for snippet replacements which are used with /snipname/ anywhere in a message.

Deployment

For long-term server deployments, an example systemd service is available here. It is strongly recommended to use this service for any long-term deployments as it it includes parameters to improve security and restrict the system resources the bot can utilize to limit damage if something goes awry. The example assumes that the bot will run under an independent user named pyrobud with a virtual environment located at /home/pyrobud/venv and a Git clone of the bot located at /home/pyrobud/pyrobud. This setup avoids tainting the system's Python install with unmanaged packages and allows the bot to self-update using Git.

If you're using Docker to run the bot, use pyrobud-docker.service instead.

tmux or screen should never be used to run the bot in production. A supervisor, unlike a terminal multiplexer, contains a plethora of features crucial for proper deployments: automatic ratelimited restarting, logging, monitoring, and more. Some, such as systemd, also support limiting resources and and imposing restrictions for security. A shell script that invokes Python in a while loop is not a replacement for a proper supervisor.

Contributing

See the Contribution Guidelines for more information.

Module Development

You can easily develop custom modules! See the Module Development Handbook for more information.

Support

Feel free to join the official support group on Telegram for help or general discussion regarding the bot. You may also open an issue on GitHub for bugs, suggestions, or anything else relevant to the project.

More Repositories

1

safetynet-fix

Google SafetyNet attestation workarounds for Magisk
C++
6,132
star
2

android12-extensions

Enable and customize hidden features on Android 12.
Kotlin
432
star
3

fastboot.js

WebUSB implementation of the Android fastboot protocol
TypeScript
388
star
4

proton-clang

Proton Clang toolchains builds in the form of a continuously updating Git repository. Clone with --depth=1.
C
298
star
5

android-webinstall

Easy-to-use web installer for Android-based operating systems
Vue
250
star
6

adevtool

Android ROM device support and bringup tool, designed for maximum automation and speed.
TypeScript
214
star
7

base16-kitty

Base16 color scheme template for kitty
Mustache
194
star
8

freqbench

Comprehensive CPU frequency performance/power benchmark
Python
164
star
9

cbackup

Fast & complete app + data backup script for Android
Shell
86
star
10

tipatch

A patcher for TWRP to backup internal storage/emulated SD card contents (photos, downloads, videos, etc).
Kotlin
71
star
11

touchpaint

An experimental Linux kernel module that demonstrates the lowest possible input latency on modern smartphones. Not for Android or production use.
C
65
star
12

linux-virtcontainer

Guest kernel for Nestbox (rootless VM containers on Android)
C
61
star
13

colorkt

Modern color science library for Kotlin Multiplatform and Java
Kotlin
60
star
14

android_packages_apps_RepainterServicePriv

First-class custom ROM integration service for my Repainter app
Kotlin
59
star
15

inter-font-pack

Magisk module that replaces Android's system fonts with Inter and other complementary fonts.
Shell
51
star
16

proton_kernel_redbull

Proton Kernel for the Pixel 5 (redfin) and Pixel 4a 5G (bramble), unified as redbull.
C
44
star
17

proton_zf6

Proton Kernel for the Asus Zenfone 6 (2019), codename Kirin and also known as I01WD and ZS630KL.
C
42
star
18

proton_bluecross

Proton Kernel for the Pixel 3 (blueline) and Pixel 3 XL (crosshatch) unified as bluecross. (discontinued)
C
36
star
19

base16-termux

Base16 for Termux
Mustache
27
star
20

proton_wsl2

Proton Kernel for the Windows Subsystem for Linux 2 (WSL 2). Highly experimental and always at the mercy of Windows Update.
C
26
star
21

proton_kernel_wahoo

Proton Kernel for the Pixel 2 (walleye) and Pixel 2 XL (taimen), unified as wahoo.
C
26
star
22

aarch64-elf-gcc

GCC 9.2.0 + binutils 2.32 toolchain for x86_64 hosts, targeted for bare-metal (ELF / kernel-only) AArch64 systems.
C
25
star
23

earlypilot

All-in-one server for monetizing software development with the early access supporter model
Kotlin
23
star
24

glcolortest

GLSL shader for testing color science and palette generation algorithms interactively
GLSL
23
star
25

kramflash

A fast & simple bootable GKI kernel flasher for boot image v2 and v3 devices.
Perl
20
star
26

benchkit

A developer-centric toolkit module for Android to facilitate in-depth profiling and benchmarking. MOVED to official Magisk module repo: https://github.com/Magisk-Modules-Repo/benchkit
Shell
20
star
27

ulog

Simple, fast, efficient logging facade for Android apps
Kotlin
18
star
28

mainline_kernel_easel

Mainline Linux kernel for the Pixel Visual Core image coprocessor (codename Easel/Monette Hill) found in the Pixel 2 and 3.
C
17
star
29

protonaosp.kdrag0n.dev

Website for @ProtonAOSP, a minimal Android fork focused on UI/UX and performance.
JavaScript
17
star
30

touchpaint-android

Touchpaint Android app for latency testing, corollary to the Linux kernel module: https://github.com/kdrag0n/touchpaint
Kotlin
16
star
31

arm-eabi-gcc

GCC 9.2.0 + binutils 2.32 toolchain for x86_64 hosts, targeted for bare-metal (ELF / kernel-only) AArch32 systems.
C
15
star
32

kdrag0n.dev

My personal website.
HTML
13
star
33

fxdsp

Fast and simple C++ DSP engine with high-quality effects. Originally built for PhantomAmp, an Android app for rootless system-wide audio effects.
C++
13
star
34

app-utils

Select parts of my homegrown library for Android app development
Kotlin
11
star
35

linux-m1

My experiments with Linux for the Apple M1 platform, based on Asahi and Corellium patches
C
11
star
36

drone-ssh-debug

A Drone plugin to enable remote build monitoring and debugging over SSH.
Shell
10
star
37

touchpaint-flutter

Touchpaint Flutter app for touch latency testing, corollary to the Android app: https://github.com/kdrag0n/touchpaint-android
Dart
9
star
38

velocity_tissot

Velocity Kernel for the Xiaomi Mi A1 (tissot). (discontinued)
C
9
star
39

callbench

A program to measure the speed of simple time syscalls and vDSO calls, as well as basic in-memory file I/O using the mmap(2) and read(2) syscalls.
C
9
star
40

eas_sdm660

An accurate, performant, and power-efficient EAS energy model for the Qualcomm Snapdragon 660 SoC (codename sdm660). THIS IS NOT A FULL EAS IMPLEMENTATION.
C
8
star
41

velocity_dream

Velocity Kernel for the Samsung Galaxy S8/S8+ (dreamlte/dream2lte). (discontinued)
C
8
star
42

github-releases-proxy

GitHub Releases asset proxy for Cloudflare Workers
JavaScript
7
star
43

kbench

A Linux kernel microbenchmark suite.
Go
7
star
44

blurtest

Test implementation of dual-filter Kawase blur in OpenGL ES 3.1, in the form of an Android app.
Kotlin
6
star
45

confirmationui-test

Simple app for testing Android Protected Confirmation (Confirmation UI)
Kotlin
6
star
46

serenade-calhacks23

TypeScript
6
star
47

aoc2021

My solutions for Advent of Code 2021
Python
5
star
48

DeviceSink

Android 11 device controls kitchen sink with all possible device types for testing.
Kotlin
5
star
49

caf4.14_kernel_wahoo

CAF 4.14 kernel for msm8998 wahoo
C
5
star
50

allocbench

Benchmark memory allocators realistically with techniques from Android, such as real-world trace replaying.
C++
5
star
51

passt-virtcontainer

C
5
star
52

caf_kernel_wahoo

CAF 4.4-based kernel for the Pixel 2 / XL (walleye/taimen), unified as wahoo. Note that this is a proof-of-concept which cannot fully boot Android due to encryption issues.
C
5
star
53

msft-wsl2-kernel

An OLD and ABANDONED import of Microsoft's customized WSL2 Linux kernel with differentiated changes. Please use Microsoft's official up-to-date repository: https://github.com/microsoft/WSLv2-Linux-Kernel
C
5
star
54

aoc2020

My Advent of Code 2020 solutions in Rust and Python.
Python
4
star
55

SwiftUI-AKList

Fast, stable, flexible SwiftUI wrapper for AppKit's NSOutlineView
Swift
3
star
56

kdrag0n

Profile
3
star
57

archenemy

ArchEnemy Linux โ€” a spin of Arch's official archiso live rescue disk with additional tools, tailored for my use.
Shell
3
star
58

speedscribble-htn2021

Hack the North 2021 team project: Draw against your friends in 1 minute!
JavaScript
3
star
59

soca-treehacks24

JavaScript
2
star
60

stock_kernel_bluecross

A flashable stock kernel package for the Pixel 3 (blueline) and Pixel 3 XL (crosshatch) unified as bluecross/b1c1. Files extracted from Google factory images.
Shell
2
star
61

proprietary_vendor_asus

Proprietary vendor blobs for Asus devices, currently only the ZenFone 6 (I01WD).
Makefile
2
star
62

nanotap

A daemon that parses and dumps touch input events on Linux.
Go
2
star
63

structalgo

My implementations of various data structures and algorithms in C.
C
2
star
64

github-release-redirector

A simple Go web server that redirects a configured list of paths to the latest release asset on a GitHub repository.
Go
2
star
65

quicklock

Research project: Secure smart lock protocol with auditing and access control delegation.
Kotlin
2
star
66

hueflake-issues

Issue tracker for Hueflake
2
star
67

freebsd_easel

FreeBSD ported to the Pixel Visual Core (codename Easel/Monette Hill).
C
2
star
68

vardbg

A simple Python debugger and profiler, written for GCI 2019. Moved to CCExtractor.
Python
2
star
69

netbsd_easel

NetBSD ported to the Pixel Visual Core (codename Easel/Monette Hill).
2
star
70

aoc2022

Advent of Code 2022 solutions
Python
2
star
71

gtcycles

A tool to measure the frequency of the generic timer on ARMv8 CPUs.
C
1
star
72

binderlat

A Go program to measure the latency of Binder IPC transactions on Android.
Go
1
star
73

slack-greeter

A simple Slack bot to greet new members of a workspace, written in Rust for GCI 2019.
Rust
1
star
74

platform_packages_modules_Connectivity

Java
1
star
75

pyrowall

Prototype Telegram bot with module and command discovery written in Go using gotgbot.
Go
1
star
76

biowave

A fast Discord bot prototype written in Go with module and command discovery.
Go
1
star
77

plushed

An Android plushie recognizer using Flutter and TensorFlow, made for GCI 2019.
Dart
1
star
78

flex-gestures

A failed attempt at a fluid iPhone X-like gestures app for Android that doesn't require root.
Kotlin
1
star
79

gci-stats

A simple stats fetcher for Google Code-in that supports sending data to Graphite.
Python
1
star
80

android_device_asus_I01WD

Old Android 10 device tree for AOSiP on the Asus ZenFone 6.
C++
1
star
81

bluestone

A discontinued multi-purpose Discord bot written in Java, available for reference purposes.
Java
1
star
82

osrc_dream

Samsung OSRC updates for the Exynos Galaxy S8/+ (dreamlte/dream2lte) as Git commits.
C
1
star
83

HierarchialPerformanceTest.jl

Julia implementation of Non-parametric Hierarchial Performance Testing, a statistical technique for comparing the performance of different computers.
Julia
1
star