Surfgram is a high-level, object-oriented framework for building scalable Telegram bots with minimal boilerplate. It's designed for developers who want a clean architecture without sacrificing flexibility.
- Pure OOP – Classes and dependency injection
- Fast Setup – Get a bot running in 1 command in terminal
- Extensible – Add custom handlers, filters, and integrations
- Async-Ready – Built with asyncio for high performance
- Full support for Telegram Bot API 9.0+
-
Install using PIP:
pip install surfgram
-
Create your first bot:
surfgram new mybot cd mybot surfgram run
from surfgram import APIObject, Bot
from surfgram.types import BotCommand
from typing import Callable, List
class StartCommand(BotCommand):
@property
def __names__(self) -> List[str]:
return ["start"]
@property
def __callback__(self) -> Callable:
return self.handle
async def handle(
self,
update: APIObject,
bot: Bot
) -> None:
await bot.send_message(
chat_id=update.message.chat.id,
text="Hello, world!"
)📖 Full documentation
📚 Examples
We welcome contributions! Please read our Contributing Guidelines for more information on how to get started.
🐞 Report a bug
💡 Start a discussion
📮 Join our Telegram Channel
MIT License. See LICENSE for more details.