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.