Tags: AeonOrg/Electrogram
Tags
feat(api): upgrade to Telegram layer 224 and extend client features ## Summary by Sourcery Update to Telegram API layer 224 and extend client features accordingly. New Features: - Support live photos and associated video documents in input and message media types. - Enhance polls with open answers, answer/media metadata, attached media, unread vote tracking, and richer poll result structures. - Introduce AI-assisted message composition and diff entities for representing edits in formatted text. - Add story music support and richer poll-related reply, dialog, and notification fields, including poll-specific unread counts and filters. - Provide new bot management APIs for creating bots, managing bot tokens, web view buttons, and managed bots. - Expose URL auth enhancements including app verification metadata and app-specific flags. - Extend messages API with read metrics, music listening reports, poll answer management, and tone-aware translation/summarization options. - Add support in high-level send/copy message helpers for repeated scheduling, paid stars, message effects, quick replies, send-as, background sending, draft clearing, sticker set order updates, and suggested posts. Enhancements: - Augment user and userFull types with additional bot management capabilities and security risk flags. - Extend reactions notification settings to cover poll vote notifications. - Include new message entities for representing insert/replace/delete diffs in text content. - Wire message_effect_id through message copy helpers to preserve or apply visual effects on copied messages. - Update stories send/edit methods to handle optional music documents on stories. Documentation: - Expand Python method docstrings for send_cached_media and copy_message with descriptions of new sending options. - Update project and documentation configuration URLs to point to the new GitHub organization/repository. Chores: - Bump Telegram schema comment from layer 223 to layer 224 and refresh lockfile metadata. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
feat(api): generate TL-based raw docs and support draft message strea… …ming ## Summary by Sourcery Integrate TL schema–driven documentation generation for raw API objects and add support for streaming drafted text messages. New Features: - Add TLDocGenerator to build TL-based signatures, parameter trees, and examples for raw API documentation pages. - Expose a new send_message_draft client method and corresponding Messages mixin to stream drafted text messages using SendMessageTextDraftAction. - Introduce a new ChatAction enum member for message draft streaming status. Enhancements: - Wire TLDocGenerator into the docs compiler pipeline to enrich raw API docs with TL signatures, parameter trees, and usage examples. CI: - Relax error handling in the fetch_mtproto workflow so API schema checks do not fail the step immediately. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com>
feat(api): upgrade to Telegram layer 223 and extend messaging and sto… …ries ## Summary by Sourcery Update Pyrogram to Telegram API layer 223 and extend messaging, stories, and bot capabilities while making parsing and type handling more robust. New Features: - Support additional message options across send, copy, and forward operations, including repeated scheduling, paid stars, background sending, quick reply shortcuts, send-as identity, media caption stripping, suggested posts, and game score forwarding. - Expose new fields and behaviors from Telegram for stories, polls, reactions, callback queries, and story views, including outgoing/min flags, albums, reactions metadata, and business callback context. - Add support for new Telegram no-forwards controls, chat and channel ranks, and related admin log and permission flags, as well as updated URL auth flow with match codes and in-app origin metadata. Bug Fixes: - Fix potential crashes when parsing entities, venues, media areas, reactions, message reaction updates, and story-related data by adding null checks and early returns. - Correct vector size computation to use integer division, preventing misreads when decoding MTProto vectors. Enhancements: - Improve robustness of parsers and type constructors by allowing optional or union-typed fields, filtering out invalid parsed objects, and handling missing or null data more gracefully. - Update low-level MTProto layer definitions and vector handling, including layer version bump, integer division fix, and new/changed constructors for core types like messages, participants, and admin rights. - Allow richer editing of stories with direct binary uploads for media and better MIME type detection, and include animations in media group replies. - Tighten connection and session handling by making proxy typing explicit and surfacing disconnects when receiving empty responses from the server. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
feat(mtproto): sync TL schema with upstream and add automated update … …workflow ## Summary by Sourcery Refresh documentation styling and MTProto schema integration, add automated schema update tooling, adjust business payment API naming, and tighten dependencies and CI branches. New Features: - Introduce automated MTProto API schema fetch-and-update tooling with a scheduled GitHub Actions workflow. - Add categorized enum documentation pages, including a dedicated ButtonStyle enum page. - Expose new Str and Link types across public type packages and business refund_stars_payment aliasing. Bug Fixes: - Correct various TL schema flag orders, field names, and removed/added constructors to match current API behavior. - Ensure error generation recreates destination packages cleanly and initializes __init__ correctly. - Keep CI workflows targeting beta and main branches appropriately for docs, tests, and publishing. Enhancements: - Modernize docs theme appearance with updated typography, code blocks, tables, scrollbars, and header styling. - Improve Sphinx configuration with preserved defaults, extra warning suppression, custom fonts, and additional theme features. - Refactor error compiler paths and template handling for more robust, path-safe generation. - Align TL schema (main_api.tl) with upstream Telegram Desktop definitions and layer metadata. - Update dev and docs dependencies to pinned minimum versions in pyproject.toml and lock files. - Fix minor docstring and reference issues in Chat type documentation and align business refund method naming. Build: - Tighten core, dev, and docs dependency versions and regenerate associated lockfiles to reflect updated constraints. CI: - Retarget docs and format/test workflows to run on the beta branch and adjust publish workflow to trigger from main. - Add scheduled workflow to periodically check MTProto API schema updates and open/update PRs automatically. Deployment: - Automate MTProto schema updates through a dedicated workflow that compiles API and error modules and pushes update branches. Documentation: - Restructure enums documentation index into logical categories and generate per-enum pages. - Create placeholder docs for decorators and support sections and wire new ButtonStyle enum documentation. - Visually refine documentation via custom CSS and Sphinx theme options. Chores: - Introduce dev_tools/check_api_schema_updates.py utility for fetching, normalizing, and writing the latest MTProto schema. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
feat(api): add new Telegram features, button styles, and async path s… …upport ## Summary by Sourcery Add support for new Telegram API features including suggested posts, fact-check metadata, advanced gifts, button styles, and paid/quick-reply messaging options, while updating filesystem operations to use async paths and improving compiler and CI tooling. New Features: - Expose concrete type exports for Pyrogram types, bots, bot commands, stories, business objects, and updates to provide a stable public surface. - Extend the Gift payment type with additional fields and support for unique gifts from new raw API types. - Augment Message, Chat, and User models with fields for stories, paid content, fact-checking, scheduling, and verification metadata from the latest Telegram API. - Introduce SuggestedPost, StarsAmount, and FactCheck helper types to represent new business and message metadata structures. - Allow button types to accept a higher-level ButtonStyle enum and optional icon, with automatic conversion to KeyboardButtonStyle. - Add rich options to message and media sending methods (schedule repeat, paid stars, quick replies, send-as, background sending, drafts, and suggested posts). - Add helper for building InputQuickReplyShortcut objects from IDs or names. Enhancements: - Switch many file existence and directory operations from pathlib.Path to anyio.AsyncPath to avoid blocking the event loop in async contexts. - Simplify and harden compiler/docs generation by using pathlib, list comprehensions, and safer directory traversal. - Mark core TLObject and Object types as unhashable to prevent misuse in hashed collections. - Tighten chat privileges with a flag for managing direct messages and expose additional chat/user metadata like bot verification icons and paid message pricing. Build: - Ensure compiler steps only run for wheel/install Hatch targets and relax some ruff lint rules while adding anyio as a runtime dependency. CI: - Update formatting-and-tests workflow to install pytest-asyncio alongside pytest for running async tests. Documentation: - Generate explicit __all__ exports for several type submodules and adjust docs compiler to better categorize and list types and enums in the API reference. Tests: - Enable pytest-asyncio with function-level async loop scope in project configuration and CI, and ensure CI installs pytest-asyncio. Chores: - Add a script to scrape and cache Telegram API documentation metadata for constructors, methods, and types for internal compiler use. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
feat(keyboards): add configurable KeyboardButtonStyle support ## Summary by Sourcery Add support for configurable button styles across keyboard button types and integrate the new style type into serialization, deserialization, and documentation. New Features: - Introduce a KeyboardButtonStyle type to represent button appearance options such as primary, danger, success, and custom icons. - Allow InlineKeyboardButton, KeyboardButton, and InlineKeyboardButtonBuy to accept an optional style attribute and propagate it through read/write conversions. Enhancements: - Wire KeyboardButtonStyle through LoginUrl button creation and export it from the bots_and_keyboards package and top-level namespace. - Update compiler docs to reference the new KeyboardButtonStyle type in the bot keyboards section. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
something: I forgot. ## Summary by Sourcery Update documentation build process to use uv-based workflows and simplify synchronous client utilities. Enhancements: - Adjust emoji status parsing to support collectible emoji statuses and optional until dates while preserving raw data. - Simplify client run logic to always use asynchronous start/idle/stop flow and remove deprecated sync context management and run_sync utilities. - Tidy various small style and docstring formatting issues across filters, raw primitives, and type docstrings. - Import compose and idle directly from methods.utilities instead of the removed sync module. Build: - Switch docs build script and GitHub workflows to use uv for Python setup, dependency sync, and Sphinx invocation. - Pin Sphinx version for docs extra to <8.0.0 and adjust Sphinx config paths for templates, static files, and LaTeX logo. CI: - Update docs generation and format/test workflows to install Python via setup-python, install uv, and rely on uv sync and uv run instead of manual pip and tool management. Chores: - Add uv.lock and update .gitignore accordingly. - Apply minor formatting tweaks for gzip-packed and string primitives. --------- Signed-off-by: 5hojib <yesiamshojib@gmail.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
API: update layer. Updated the API schema to layer 224. The changes include: Fetching the new TL schema from the provided URL. Updating compiler/api/source/main_api.tl while maintaining required core types and setting the layer version. Updating the project version in pyrogram/__init__.py. Running the error scraper to fetch the latest error descriptions. Regenerating the raw API code and error exceptions. All generated files have been updated to reflect layer 224. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
PreviousNext