Friendly-Telegram is a modular and secure userbot for Telegram, written in Python.
The documentation is here and the source code is here.