Skip to main content

shadism (شادیسم) ⚡

PyPI Version Python Version License Documentation Bale Channel

shadism is an ultra-high-performance, modern, and fully asynchronous Python SDK and UserBot framework for the Shad messenger protocol.

Designed from the ground up with native asyncio, client-side end-to-end encryption (AES-256-CBC + RSA), rich object-oriented models, and declarative message filtering.


👨‍💻 Developer & Community


🚀 Key Features

  • ⚡ 100% Asynchronous: Built entirely on asyncio and httpx with HTTP/2 support.
  • 🔐 End-to-End Encryption: Automated key generation, passphrases, AES-CBC payload encryption, and RSA authentication.
  • 🎯 Declarative Filters: Chainable event filters (filters.command, filters.regex, filters.group, filters.private, &, |, ~).
  • 📜 Smart Chat History: get_chat_history() with automatic batch pagination, deduplication, and update fallback.
  • 📁 Automated Media Streaming: Chunked file upload (UploadFile.ashx) and automatic photo thumbnail generation.
  • 🎙️ Voice Chat (WebRTC): Group and channel voice chat creation, joining, speaking activity control, and participants management.
  • 🧩 Rich OOP Models: Direct interaction with Message, Chat, and User objects (await msg.reply(), await msg.delete(), await chat.send_message()).

📦 Installation

All dependencies (httpx, h2, cryptography, Pillow) are automatically installed:

pip install shadism

⚡ Quickstart

1. Simple Echo / Ping Bot

import asyncio
from shadism import Client, filters

bot = Client("0937xxxxxxx")

@bot.on_message(filters.command("ping"))
async def ping_handler(message):
    await message.reply("🏓 pong!")

@bot.on_message(filters.command("start"))
async def start_handler(message):
    await message.reply("سلام! ربات شادیسم با موفقیت راه‌اندازی شد. 🚀")

async def main():
    await bot.start()

if __name__ == "__main__":
    asyncio.run(main())

2. Fetching Chat History (get_chat_history)

from shadism import Client

bot = Client("0937xxxxxxx")

@bot.on_message
async def history_example(message):
    if message.text == "تاریخچه":
        history = await bot.get_chat_history(message.chat_guid, limit=20)
        for msg in history:
            print(f"[{msg.id}] {msg.author_guid}: {msg.text}")

3. Sending Photos and Files

# Send photo with automatic thumbnail generation
await bot.send_photo(
    object_guid="u0DoNvd...",
    photo="banner.jpg",
    caption="تصویر جدید 🖼️"
)

# Send documents and files
await bot.send_file(
    object_guid="u0DoNvd...",
    file="document.pdf",
    caption="فایل ضمیمه 📄"
)

4. Interactive Two-Way Message Cleaner

@bot.on_message
async def clean_messages(message):
    if message.text == "پاکسازی":
        messages = await bot.get_chat_history(message.chat_guid, limit=50)
        to_delete = [
            m.id for m in messages 
            if m.author_guid == bot.session.user_guid
        ]
        if to_delete:
            await bot.delete_messages(message.chat_guid, to_delete, delete_type="Global")
            await bot.send_message(message.chat_guid, f"عملیات انجام شد: {len(to_delete)} پیام پاک شد.")

📖 License

This project is licensed under the MIT License. See the LICENSE file for details. Developed by AmirAli khosravinejad.

Metadata

Release files for shadism 1.0.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 shadism 1.0.0
File Size Uploaded Provenance Actions
shadism-1.0.0.tar.gz 39.8 kB Without provenance Details for shadism-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 67.3 kB

Release files / shadism-1.0.0.tar.gz

Download URL shadism-1.0.0.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4e436fe976e1fc85872d049476f36c50e2f539c2fa45ddb1f9e2193c9b2760c1
BLAKE2b-256 checksum
How to use checksums
91a9d391b45a2b240f677fa327062c765ca7b7c691e66e463156cd64d797df6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / shadism-1.0.0-py3-none-any.whl

Download URL shadism-1.0.0-py3-none-any.whl
Size 27.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25030bbeca8b2a0d6deee9bd7241ea3ec13421ebf6f304f1179544d5c01b3930
BLAKE2b-256 checksum
How to use checksums
14d670bc9294862c68ea474a4b41d6a930b1efd7291c710004d5dbb9893b0233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for shadism 1.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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