Skip to content

surfgram/surfgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Surfgram

Surfgram Logo
PyPI Version Python 3.8+ Telegram Bot API 9.0+ MIT License

Overview

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.

Key Features

  • 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+

Quick Start

  1. Install using PIP:

    pip install surfgram
  2. Create your first bot:

    surfgram new mybot
    cd mybot
    surfgram run

Example bot's handler

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!"
        )

Documentation

📖 Full documentation
📚 Examples

Contributing

We welcome contributions! Please read our Contributing Guidelines for more information on how to get started.

Support

🐞 Report a bug
💡 Start a discussion
📮 Join our Telegram Channel

License

MIT License. See LICENSE for more details.

About

A modern async framework for Telegram Bot API

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages