Skip to main content

darkob

darkob

Fast, stable async Python for the Rubika & Shad platforms.
Build bots and userbots that stay up.

PyPI Downloads Python CI License Stars

Documentation · AI context · PyPI · Issues


pip install darkob
from darkob import Bot, Keyboard

bot = Bot(token="YOUR_BOT_TOKEN")

@bot.on_command("start")
async def start(bot, event):
    await event.reply("Welcome 👋")

@bot.on_new_message()
async def echo(bot, event):
    await event.reply(event.text, inline_keypad=Keyboard().row("Yes", "No"))

bot.run()

Why darkob

A fork of maxrubika, rebuilt so failures are visible and the fast paths are actually fast.

Inherited problem What darkob does
Contacted PyPI at import time Importing performs no network I/O
TLS verification disabled everywhere Verification on by default, opt out explicitly
Bare except: swallowed KeyboardInterrupt Narrowed to Exception and logged
Background handler crashes vanished at GC Logged the moment they happen
Every event scanned all handlers Indexed dispatch, built once
Retries were endpoints × max_retries Bounded budget with jitter and 429 handling
A new TLS handshake per file download Pooled sessions per host
Saved sessions were opened but never read back Credentials restored; sessions survive restarts
A corrupt session file was deleted Quarantined, never destroyed

What's inside

Two surfaces, one library

Bot for the official Bot API. Messenger for real user accounts — channels, groups, voice chats, settings. Shad is the same protocol against Shad's hosts.

Async first, sync friendly

Every method works with await or without it. One background loop, no per-call threads.

Composable handlers

Decorators, 42 filters with &, |, ~, middleware, routers, and a global on_error handler.

Conversations that survive restarts

FSMContext with memory or JSON storage, and StateFilter to route by step.

Shortcuts that save lines

event.reply(...), bot.reply(event, text), bot.edit(event, text), bot.iter_updates().

Keyboards and formatting

Keyboard().row("Yes", "No") instead of nested dicts. bold(), italic(), link(), spoiler() and friends.

Documentation

Full site: manitheferfri.github.io/darkob

Quickstart Install to running bot in five minutes
Handlers Every decorator and what triggers it
Filters All 42 constraints and how to compose them
Routers Split a bot into modules
Conversations Multi-step flows
Keyboards Keypads and text formatting
Errors Exception hierarchy and retries
Bot API · Messenger API Generated from the package
Roadmap What ships next, and what will not

Built for AI-assisted development

Most darkob bots are written by an assistant, so the docs are built to be read by a model.

https://manitheferfri.github.io/darkob/llms-full.txt

That single file is the whole thing: hard rules, every guide, and the full API with complete docstrings for all 688 methods — 318 KB, one fetch, no follow-up links.

  • llms.txt — curated map
  • api.json — every method as JSON
  • Every page is also served as raw Markdown: append .md to any URL
  • The API reference is generated from the installed package, so it cannot drift from the code

Development

git clone https://github.com/ManiTheFerfri/darkob.git
cd darkob
pip install -e ".[dev]"

pytest --cov=darkob    # 290 tests, no network required
ruff check .           # lint

The suite never opens a socket: HTTP goes through fake transports, and a subprocess test asserts that importing darkob cannot reach the network.

License

MIT. Derived from maxrubika, copyright MEHRAB Farahmand; the original MIT notice is preserved in LICENSE.

Maintained by Mani Keikhosravi.

Not affiliated with Rubika or Shad. Use responsibly and in line with the platforms' terms of service.

Metadata

Release files for darkob 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for darkob 0.4.0
File Size Uploaded Provenance Actions
darkob-0.4.0.tar.gz 206.3 kB With provenance Details for darkob-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for darkob 0.4.0
File Interpreter ABI Platform Actions
darkob-0.4.0-py3-none-any.whl Python 3 none any Details for darkob-0.4.0-py3-none-any.whl

Total release size: 567.0 kB

Release files / darkob-0.4.0.tar.gz

Download URL darkob-0.4.0.tar.gz
Size 206.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0e54bf34d7c9edd0d2cfc6291de384f77d6dc3eb60e998b1a768c628369195fe
BLAKE2b-256 checksum
How to use checksums
42db94b8c1239188e9fc09d7108f741bd728b3c7a5c2fe9b2bb703703c7a35f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / darkob-0.4.0-py3-none-any.whl

Download URL darkob-0.4.0-py3-none-any.whl
Size 360.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
511a84caf2d5c407cac2960b1b137575cb3699bac409f8791f242a206261a8eb
BLAKE2b-256 checksum
How to use checksums
e9954b0d86310283ce319b2a67838cf12874de0d9ff44d3fa98d0359beaa7f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for darkob 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for darkob-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page