Skip to main content

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

Project description

Sepgram
Sepgram
Telegram MTProto API Framework for Python

GitHub โ€ข Documentation


About

Sepgram is a modern, elegant and asynchronous Telegram MTProto API framework in Python for users and bots. Dengan fitur tambahan dan update layer terbaru.

  • Layer: 225 (terbaru)
  • Version: 2.0.225
  • Python: 3.8+
from pyrogram import Client, filters

app = Client("my_account")

@app.on_message(filters.private)
async def hello(client, message):
    await message.reply("Hello from Sepgram!")

app.run()

Installation

pip install git+https://github.com/maxsepp/sepgram

Features & Support

๐Ÿ”Œ Core

Feature Status
MTProto API Layer 225 โœ…
Userbot & Bot support โœ…
Async & Sync mode โœ…
TgCrypto (C crypto) โœ…
Type-hinted โœ…
Session string support โœ…
SQLite / Memory storage โœ…
Proxy support (TCP) โœ…
Multiple sessions โœ…
Auto-reconnect โœ…

๐Ÿ’ฌ Messages

Feature Status
Send text, photo, video, audio, document, sticker โœ…
Send animation (GIF) โœ…
Send voice & video note โœ…
Send location & venue โœ…
Send contact โœ…
Send dice โœ…
Send poll โœ…
Send media group โœ…
Send cached media โœ…
Send game โœ…
Forward messages โœ…
Copy messages โœ…
Edit messages (text, caption, media, reply_markup) โœ…
Delete messages โœ…
Pin / unpin messages โœ…
Search messages (chat & global) โœ…
Get chat history โœ…
Get media group โœ…
Download & stream media โœ…
Send reactions โœ…
Read reactions โœ…
Schedule messages โœ…
Discussion replies โœ…
Screenshot notification โœ…

๐Ÿ“– Stories

Feature Status
Send story โœ…
Edit story โœ…
Delete stories โœ…
Forward story โœ…
Copy story โœ…
Get stories (peer, pinned, archive, all) โœ…
Pin / hide stories โœ…
Story albums (create, update, delete, get) โœ…
Increment story views โœ…
Read stories โœ…
Export story link โœ…
Can send story check โœ…

โญ Premium & Stars

Feature Status
Get stars balance โœ…
Get stars status โœ…
Get stars transactions โœ…
Send star gift โœ…
Save star gift โœ…
Convert star gift โœ…
Upgrade star gift โœ…
Get star gifts โœ…
Update star referral program โœ…
Apply boost โœ…
Get boosts / boosts status โœ…
Custom emoji stickers โœ…
Emoji status โœ…

๐Ÿ‘ฅ Chats & Groups

Feature Status
Create channel / group / supergroup โœ…
Delete channel / supergroup โœ…
Join / leave chat โœ…
Get chat info โœ…
Get chat members โœ…
Ban / unban / restrict / promote members โœ…
Set chat title, photo, description, username โœ…
Set permissions โœ…
Set slow mode โœ…
Set protected content โœ…
Archive / unarchive chats โœ…
Mark chat unread โœ…
Get common chats โœ…
Get online count โœ…
Transfer chat ownership โœ…
Delete user history โœ…
Get send as chats โœ…
Chat notifications โœ…
Chat event log โœ…

๐Ÿ“‚ Forum Topics

Feature Status
Create forum topic โœ…
Edit forum topic โœ…
Delete forum topic โœ…
Close / reopen forum topic โœ…
Get forum topics โœ…
Toggle forum topics โœ…
Hide / unhide general topic โœ…
Edit / reopen general topic โœ…

๐Ÿ”— Invite Links

Feature Status
Export chat invite link โœ…
Create chat invite link โœ…
Edit chat invite link โœ…
Revoke chat invite link โœ…
Delete chat invite links โœ…
Get invite link joiners โœ…
Get chat join requests โœ…
Approve / decline join requests โœ…
Export folder link โœ…

๐Ÿค– Bots

Feature Status
Answer callback query โœ…
Answer inline query โœ…
Answer web app query โœ…
Answer guest query โœ…
Get inline bot results โœ…
Send inline bot result โœ…
Set/get bot commands โœ…
Set/get bot default privileges โœ…
Set/get chat menu button โœ…
Get bot recommendations โœ…
Request callback answer โœ…
Set game score / get high scores โœ…
Edit inline text/caption/media/reply_markup โœ…

๐Ÿ’ณ Payments

Feature Status
Stars payments โœ…
Stars transactions โœ…
Star gifts (send, save, convert, upgrade) โœ…

๐Ÿ‘ค Users & Contacts

Feature Status
Get users โœ…
Get me โœ…
Get contacts โœ…
Add / import / delete contacts โœ…
Block / unblock user โœ…
Update profile โœ…
Set profile photo โœ…
Delete profile photos โœ…
Set username โœ…
Update color โœ…
Update status โœ…
Get sessions โœ…
Set custom verification โœ…

๐Ÿ“ Folders

Feature Status
Get folders โœ…
Get folder โœ…
Update folder โœ…
Delete folder โœ…
Export folder link โœ…

๐ŸŽจ Stickers

Feature Status
Get sticker set โœ…
Create sticker set โœ…
Add sticker to set โœ…
Get custom emoji stickers โœ…

๐Ÿ” Auth & Password

Feature Status
Send code โœ…
Resend code โœ…
Sign in / sign up โœ…
Sign in bot โœ…
Check password โœ…
Enable / change / remove cloud password โœ…
Get password hint โœ…
Recover password โœ…
Two-step verification โœ…
Terms of service accept โœ…

๐Ÿ”ง Pyromod Extensions

Feature Status
client.listen() โ€” wait for message/callback โœ…
client.ask() โ€” send & wait for reply โœ…
register_next_step_handler() โœ…
stop_listener() / stop_listening() โœ…
Listener timeout handling โœ…
Custom keyboard helpers (ikb, kb) โœ…
InlineKeyboard with pagination โœ…
Secret eval/shell commands (owner only) โœ…

๐Ÿ›  Utilities

Feature Status
Compose (multi-client) โœ…
Idle โœ…
Export session string โœ…
Text formatter (bold, italic, code, etc.) โœ…
Available effects โœ…

๐Ÿ“ฆ Handlers

Handler Event
on_message New messages
on_edited_message Edited messages
on_deleted_messages Deleted messages
on_callback_query Callback query (button press)
on_inline_query Inline query
on_chosen_inline_result Chosen inline result
on_chat_member_updated Chat member changes
on_chat_join_request Join requests
on_poll Poll updates
on_user_status User online/offline
on_story New stories
on_disconnect Client disconnect
on_raw_update Raw MTProto updates
ErrorHandler Exception handling

๐Ÿ” Filters

Built-in filters: private, group, channel, text, photo, video, audio, document, sticker, animation, voice, video_note, contact, location, venue, dice, game, poll, media, command, regex, user, chat, forwarded, reply, caption, mentioned, via_bot, service, media_group, scheduled, from_scheduled, linked_channel, forum_topic, story, bot, new_chat_members, left_chat_member, dan lainnya.


Quick Examples

Listen for reply (Pyromod)

response = await client.ask(chat_id, "What's your name?")
await client.send_message(chat_id, f"Hello {response.text}!")

Inline Keyboard

from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton

markup = InlineKeyboardMarkup([
    [InlineKeyboardButton("Button 1", callback_data="btn1"),
     InlineKeyboardButton("Button 2", callback_data="btn2")],
    [InlineKeyboardButton("URL", url="https://telegram.org")]
])

await client.send_message(chat_id, "Choose:", reply_markup=markup)

Download Media

@app.on_message(filters.photo)
async def download(client, message):
    await message.download()

Stories

await client.send_story(privacy=enums.StoriesPrivacyRules.PUBLIC, photo="pic.jpg", caption="My story!")

License

Sepgram is licensed under the GNU Lesser General Public License v3.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sepgram-2.0.227.tar.gz (468.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sepgram-2.0.227-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

File details

Details for the file sepgram-2.0.227.tar.gz.

File metadata

  • Download URL: sepgram-2.0.227.tar.gz
  • Upload date:
  • Size: 468.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sepgram-2.0.227.tar.gz
Algorithm Hash digest
SHA256 a1c86b5e24c0319df507d0af25d802e24cea77dbfabf10272d0d4aa25ad44d8d
MD5 1cfc509f95b13c3e38e9fcfd270052e3
BLAKE2b-256 c951d60fac86a9d8aa39da3299492e713f5278e0b8301e3381d1aa6bf7904a5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sepgram-2.0.227.tar.gz:

Publisher: publish.yml on maxsepp/sepgram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sepgram-2.0.227-py3-none-any.whl.

File metadata

  • Download URL: sepgram-2.0.227-py3-none-any.whl
  • Upload date:
  • Size: 5.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sepgram-2.0.227-py3-none-any.whl
Algorithm Hash digest
SHA256 088b877020e25214f308f7578bc02264c78e30e30a24c113eb36f47c83f83f86
MD5 d8a2d8c31675773ce5fda7158a0fec2c
BLAKE2b-256 62ae9310fd2afac4fe0af22cd46e54635808aca5b462e24d0eb8884151158c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sepgram-2.0.227-py3-none-any.whl:

Publisher: publish.yml on maxsepp/sepgram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page