Skip to main content

NEXTGRAM

Telegram Bot API 10.3 rich messages and 10.4 HTML widgets for Pyrogram, Pyrofork, Kurigram, Telethon, aiogram and python-telegram-bot.

Install

pip install nextgram

Requires Python 3.10+ and httpx. Install only the framework you use.

Framework Module Optional extra
Pyrogram / Pyrofork / Kurigram nextgram.rich_ui pyrogram (Kurigram)
Telethon nextgram.telethon telethon
aiogram nextgram.aiogram_rich aiogram
python-telegram-bot nextgram.ptb_rich ptb

Quick start

from nextgram import rich_send, rich_heading, rich_kv_table

text = rich_heading("Now Playing", level=3) + rich_kv_table([
    ("Title", "Song name"), ("Duration", "3:27")
])
await rich_send(client, chat_id, text)

Native rich messages require a compatible client build. Otherwise, senders fall back to plain HTML; embedded rich buttons may become text. HTTP rich edits are not verified live.

Widgets

from nextgram import send_widget

await send_widget(None, chat_id, "<h1>Hello</h1>", token=bot_token)

Widgets support shared data, queries, inline content and TON wallet payloads. Native query handlers are used when available; other clients can parse raw updates. Pass a bot token explicitly when the client does not expose one.

Rich message API

  • RICH_AVAILABLE, rich_esc, sanitize_display_name, rich_heading, rich_note
  • rich_table, rich_kv_table, rich_details, rich_details_group, rich_details_nested
  • rich_block_details, rich_block_paragraph, rich_code, rich_pre, rich_pre_rich
  • rich_block_preformatted, rich_text_bold, rich_text_italic, rich_text_code, rich_list
  • rich_todo_list, rich_todo_list_markdown, rich_block_todo_list, rich_hr, rich_footer
  • rich_page_index, rich_pull_quote, rich_math, rich_anchor, rich_thinking
  • rich_img, rich_emoji, rich_emoji_markdown, rich_text_custom_emoji, register_custom_emoji
  • register_custom_emojis, clear_custom_emojis, custom_emoji_names, rich_emoji_named, expand_emoji_shortcodes
  • fetch_custom_emoji, rich_button, rich_button_row, rich_to_plain, rich_caption
  • add_html_hook, clear_html_hooks, rich_send, rich_send_blocks, rich_reply
  • rich_edit, rich_edit_inline, rich_answer, ephemeral_edit, ephemeral_delete
  • RichDraft

Tests

pip install -e '.[test]'
pytest

Live integration tests require Telegram credentials.

Credits

Kurigram — rich message support in the Pyrogram ecosystem.

NEXTGRAM by BadmundaXd. MIT License.

Metadata

Release files for nextgram 0.9.1

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

Source distribution (sdist)

Source distribution for nextgram 0.9.1
File Size Uploaded Provenance Actions
nextgram-0.9.1.tar.gz 27.4 kB Without provenance Details for nextgram-0.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 56.1 kB

Release files / nextgram-0.9.1.tar.gz

Download URL nextgram-0.9.1.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a1fa8bdac7ef3df04c9d0fc335a208df30ef5ed536d0434e5e44bf18bb0b39f8
BLAKE2b-256 checksum
How to use checksums
56fcacc3312f7ba98e1aa8570b7ac650a5234346dc9696251678f8bb2c612c33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / nextgram-0.9.1-py3-none-any.whl

Download URL nextgram-0.9.1-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68cc509e41b9333070b4a39f7d57b6f4a2296353608670bf1ecc14e3136c152d
BLAKE2b-256 checksum
How to use checksums
b941d604ecdd05f6e7ec5c9b2930ac13ce3d7878ae2b2924085a9861d0827248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for nextgram 0.9.1

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

0.9.1 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