Git Product home page Git Product logo

studyhepler's Introduction

bot_template logo
language issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub Repo stars Built with the Codeium Quality gate

🌟Hello everyone! This is the template for developing Telegram bots on Python with aiogram.🌟

Quick message

I recommend you look at the template for the third version of the aiogram and use it.

Motivation ❗

When I was developing Telegramia, I've used these templates: aiogram-bot-template and tgbot_template for creating bots. And I have many probles with them. So I decided to create my own template.

Diagram

Here you can understand how template works and what is imported from where.

classDiagram
    bot <|-- loader: dp
    bot <|-- aiogram: executor
    bot <|-- `tgbot.handlers`
    bot <|-- `tgbot.filters`: custom_filter
    bot <|-- `tgbot.middlewares` : custom_middleware
    bot <|-- `tgbot.services` : set_commands(), on_startup_notify()
    bot <|-- `tgbot.config` : load_config()
    `tgbot.handlers` <|-- some_handler
    `tgbot.handlers` <|-- `tgbot.keyboards`: reply_keyboard, inline_keyboard
    `tgbot.handlers` <|-- `tgbot.middlewares` : rate_limit()
    `tgbot.handlers` <|-- `tgbot.states` : custom_state
    some_handler <|-- loader: dp
    loader <|-- `tgbot.config` : load_config()
    `tgbot.keyboards` <|-- reply
    `tgbot.keyboards` <|-- inline
    `tgbot.middlewares` <|-- custom_middleware
    `tgbot.services` <|-- set_default_commands
    `tgbot.services` <|-- admins_notify
    class bot{
      loguru logger
      executor
      register_all_middlewares(dispatcher: Dispatcher)
      register_all_filters(dispatcher: Dispatcher)
      register_all_handlers(dispatcher: Dispatcher)
      register_all_commands(dispatcher: Dispatcher)
      on_startup(dispatcher: Dispatcher)
      on_shutdown(dispatcher: Dispatcher)
      executor.start_polling()
    }
    class aiogram{
        executor
    }
    class loader{
      Config config
      Bot bot
      Dispatcher dp
      MemoryStorage storage
    }
    class `tgbot.config`{
      load_config()
    }
    class `tgbot.handlers`{
    }
    class some_handler{

    }
    class `tgbot.filters`{
      custom_filter
    }
    class `tgbot.keyboards`{

    }
    class reply {
        reply_keyboard
    }
    class inline {
        inline_keyboard
    }
    class `tgbot.middlewares` {

    }
    class custom_middleware {
        rate_limit()
    }
    class `tgbot.misc` {

    }
    class `tgbot.models` {

    }
    class `tgbot.services` {

    }
    class set_default_commands {
        set_commands()
    }
    class admins_notify {
        on_startup_notify()
    }
    class `tgbot.states` {
        custom_state
    }

Examples

Installation πŸ’»

  1. Clone the repository
git clone https://github.com/mezgoodle/bot_template.git
  1. Install dependencies
pip install -r requirements.txt

Fast usage πŸ’¨

  1. Set the bot token in the tgbot.config.py file

  2. Run the bot

python bot.py

Contribute πŸƒ

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Credits 🐱🀝

License πŸ”–

MIT Β© mezgoodle

studyhepler's People

Contributors

mezgoodle avatar

Watchers

 avatar

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.