A lightweight, modular, strictly-typed asynchronous Telegram bot framework built for the modern Python ecosystem.
- Async-First: Built from the ground up leveraging concurrent, non-blocking I/O operations.
- Plug & Play Extensibility: Decoupled core logic supporting dynamic module loading. Seamlessly integrates with the official itisFarzinBotPlugins ecosystem.
- Strictly Typed: Type-hinted codebase passing strict
pyreflychecks andrufflinting.
- Python 3.10+
- uv package manager
- Telegram API credentials (
api_idandapi_hash) - A bot token from @BotFather
- Clone the repository:
git clone https://github.com/6AMStuff/itisFarzinBot.git
cd itisFarzinBot- Install dependencies:
uv sync --lockedFor faster MTProto encryption, include the
fullextra:uv sync --locked --extra full
- Configure the bot (see Configuration).
- Run the bot:
uv run -m botRun the bot container:
docker run -d \
--name itisfarzinbot \
-v ./config:/app/config \
-v ./plugins:/app/plugins \
ghcr.io/6amstuff/itisfarzinbot:latestThe bot reads its settings from config/config.yaml. Start from the bundled sample:
cp config/config.sample.yaml config/config.yamlThen edit config/config.yaml. At minimum, set api_id, api_hash, and bot_token.
| Option | Description |
|---|---|
client_name |
Session name for the Telegram client. |
api_id / api_hash |
Telegram API credentials from my.telegram.org. |
bot_token |
Bot token from @BotFather. |
in_memory |
Keep the session in memory instead of writing it to disk. |
plugins_folder |
Directory plugins are loaded from. |
log_level |
Logging level as a Python numeric level (e.g. 20 = INFO). |
log_max_size_mb |
Maximum size of a log file before it rotates. |
log_backup_count |
Number of rotated log files to keep. |
admins |
Space-separated list of admin usernames. |
tz |
Timezone as an IANA name (e.g. Europe/London). |
proxy |
Proxy URL for the client (e.g. socks5://127.0.0.1:8080). |
use_system_proxy |
Fall back to the system proxy when proxy is unset. |
cmd_prefixes |
Space-separated command prefixes (e.g. . /). |
db_uri |
SQLAlchemy database URI. |
plugins_repo |
Git repository used to fetch plugins. |
Users can expand their bot's functionality by obtaining plugins from the official repository: itisFarzinBotPlugins.
Install the development dependencies and run the same checks as CI:
uv sync --locked --extra dev
uv run ruff check # lint
uv run pyrefly check # type checkEnable the git hooks once to run ruff, pyrefly, and commit-message checks automatically:
uv run pre-commit installCommits follow the Conventional Commits style, enforced on commit by commitizen.
Contributions to the main bot framework are welcome! Please open issues or submit pull requests for enhancements or bug fixes. For plugin development, please refer to the plugins repository.
This project is licensed under the MIT License. See LICENSE for details.