Package: pyrobud
PyrobudPyrobud 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
theTelethonlibrary.A working installation ofPython 3.6or newer is required to run Pyrobud.CompatibilityPyrobud 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 theTermuxapp, and on iOS it
should be possible using theiSHapp.InstallationNative dependenciesPyrobud 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/DistroCommandArch Linuxpacman -S leveldbUbuntuapt install libleveldb-devmacOSbrew install leveldbTermuxapt install leveldbFreeBSDpkg install leveldbUsing DockerSimply rundocker run --rm -itv "$PWD/data:/data" kdrag0n/pyrobudto run the
latest unstable version with the data directory set todatain the current
working directory. Feel free to customize the data directory as you wish, as
long as you createconfig.tomlin 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 pipWhen 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 usingsource [target directory]/bin/activateor 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.StableYou can obtain the latest stable version from PyPI:python3 -m pip install pyrobudIf you have or can install OpenSSL development headers, installing thefastvariant is highly recommended:python3 -m pip install pyrobud[fast]Without thecryptgencryption acceleration library from thefastextras, the
bot will beextremely slowwhen dealing with any files, even small ones.
Download and upload speeds can be as slow as kilobytes per second without this
library.Bleeding-edgeFirst, clone this Git repository locally:git clone https://github.com/kdrag0n/pyrobudAfter that, you can runpython3 -m pip install .to install the bot along with
the bare minimum dependencies. However, including thefastextras is highly
recommended to improve performance:python3 -m pip install .[fast]Read the section above for more information on whatfastdoes and why you
should use it.Once it's installed, you can choose to invoke it using thepyrobudcommand, 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 pipConfigurationCopyconfig.example.tomltoconfig.tomland edit the settings as desired.
Each and every setting is documented by the comments above it.Obtain the API ID and hash fromTelegram'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.UsageTo start the bot, typepython3 main.pyif 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 thefullphone 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-8910would be entered as12345678910. Any other format will be
rejected by Telegram.After the bot has started, you can run thehelpcommand 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.helpto run the command. All other commands work the same way,
save for snippet replacements which are used with/snipname/anywhere in a
message.DeploymentFor long-term server deployments, an example systemd service is availablehere.
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 namedpyrobudwith a virtual
environment located at/home/pyrobud/venvand 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, usepyrobud-docker.serviceinstead.tmuxorscreenshould 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 awhileloop is not a replacement
for a proper supervisor.ContributingSee theContribution Guidelinesfor more information.Module DevelopmentYou can easily develop custom modules! See theModule Development Handbookfor more information.SupportFeel free to join theofficial support groupon Telegram
for help or general discussion regarding the bot. You may alsoopen an issue on GitHubfor bugs,
suggestions, or anything else relevant to the project.