Skip to main content

darkob

darkob

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

PyPI Python 3.9-3.14 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.2

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.2
File Size Uploaded Provenance Actions
darkob-0.4.2.tar.gz 206.1 kB With provenance Details for darkob-0.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 566.8 kB

Release files / darkob-0.4.2.tar.gz

Download URL darkob-0.4.2.tar.gz
Size 206.1 kB
Tags Source
SHA-256 checksum
How to use checksums
04ed8aec574456c9af6eaff7725fc10bbe8704e3b7959d3e069bdcb2d25769ee
BLAKE2b-256 checksum
How to use checksums
6a94a73bccd23b2a332391cfadc5df249d63f41ab7b0a090fdc426ae819bb7cb
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.2-py3-none-any.whl

Download URL darkob-0.4.2-py3-none-any.whl
Size 360.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cad2ec7ba671e66975f9de228ec2a9ddae5138e31e7acffbb8272e3dda003eee
BLAKE2b-256 checksum
How to use checksums
d48992e5b7105076bb452819f94b15ef0cf8285f4a05a2e70a61e79115960509
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.2

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.2.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