GithubHelp home page GithubHelp logo

tg-codegen's Introduction

aiogram

MIT License

PyPi status

PyPi Package Version

Downloads

Supported python versions

Telegram Bot API

Codecov

aiogram is a modern and fully asynchronous framework for Telegram Bot API written in Python 3.8 using asyncio and aiohttp.

Make your bots faster and more powerful!

Documentation:

Features

  • Asynchronous (asyncio docs, 492)
  • Has type hints (484) and can be used with mypy
  • Supports PyPy
  • Supports Telegram Bot API 7.3 and gets fast updates to the latest versions of the Bot API
  • Telegram Bot API integration code was autogenerated and can be easily re-generated when API gets updated
  • Updates router (Blueprints)
  • Has Finite State Machine
  • Uses powerful magic filters
  • Middlewares (incoming updates and API calls)
  • Provides Replies into Webhook
  • Integrated I18n/L10n support with GNU Gettext (or Fluent)

Warning

It is strongly advised that you have prior experience working with asyncio before beginning to use aiogram.

If you have any questions, you can visit our community chats on Telegram:

tg-codegen's People

Contributors

b0g3r avatar evgfilim1 avatar jrootjunior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tg-codegen's Issues

Parse enums from documentation

Example

We have type attribute in Chat class
image

So we should create an enum like this:

from aiogram.utils.enum import AutoName

from enum import auto


class ChatType(AutoName):
    PRIVATE = auto()
    GROUP = auto()
    SUPERGROUP = auto()
    CHANNEL = auto()

Enum class name should be generated from base class name and target field name capitalized: Chat + Type.
For MessageEntity.type field it should be MessageEntityType, so following the same rules.

More complex example

We have ChatMember and its subclasses that differ in status attribute
image

So we should create an enum like this:

from aiogram.utils.enum import AutoName

from enum import auto


class ChatMemberStatus(AutoName):
    CREATOR = auto()
    ADMINISTRATOR = auto()
    MEMBER = auto()
    RESTRICTED = auto()
    LEFT = auto()
    KICKED = auto()

Enum class name should be generated in the same way: ChatMember + Status.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.