Skip to main content

Aiogram frameworkida yozilgan Telegram bot shabloni generatori

Project description

Telegram Bot Template with Aiogram

This repository provides a template for building Telegram bots using the Aiogram framework in Python. It is designed to help you quickly start your bot development with a clean and modular structure.

Features

  • Asynchronous Telegram Bot API with Aiogram
  • Modular code organization
  • Database integration utilities
  • Easy to extend with custom handlers and commands

Installation

Option 1: Install via PyPI (Recommended 🚀)

You can install this template generator directly from PyPI:

pip install ziyodev-tg-bot

Once installed, you can generate a new bot project anywhere with a single command:

ziyodev-tg-bot init my-new-bot

This creates a new folder my-new-bot containing all the template structure. Then, simply:

cd my-new-bot
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure BOT_TOKEN and SECRET_KEY in src/.env
cd src
python manage.py migrate
python manage.py createsuperuser
python manage.py runbot

Option 2: Clone from GitHub

  1. Clone the repository:

    git clone https://github.com/Ziyodullodev/telegram-bot-shablon-aiogram.git
    cd telegram-bot-shablon-aiogram
    
  2. Create venv and run:

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    cp src/.env.example src/.env
    # Configure BOT_TOKEN and SECRET_KEY in src/.env
    cd src
    python manage.py migrate
    python manage.py createsuperuser
    python manage.py runbot
    

Configuration

Set your Telegram Bot Token in the environment or configuration file as needed.

Running the Bot

Run the bot with:

cd src
python manage.py runbot

Project Structure

  • src/ - Django Backend & Bot Application
    • config/ - Django core configurations (settings.py, urls.py)
    • users/ - Custom User model, migrations, and django admin settings
    • bot/ - Aiogram Telegram Bot application
      • management/commands/runbot.py - Bot runner command
      • handlers/ - Bot handlers and keyboards
      • locales/ - Local JSON translation files synced dynamically via signals

Contributing

Contributions are welcome! Feel free to fork and submit pull requests.

License

MIT License


Happy bot building! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ziyodev_tg_bot-0.3.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ziyodev_tg_bot-0.3.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file ziyodev_tg_bot-0.3.0.tar.gz.

File metadata

  • Download URL: ziyodev_tg_bot-0.3.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ziyodev_tg_bot-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bae3fcd9e6cd72729e8d3a87f8614466c7e70e70ab5a3732dda991e7c3d1b228
MD5 5a3c9def1b13dc313021dfe8d2300620
BLAKE2b-256 ff4e244ebd2daf131938e1ce5d8c863a849f28a361f6ec7d47bcc23e3f750394

See more details on using hashes here.

File details

Details for the file ziyodev_tg_bot-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ziyodev_tg_bot-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ziyodev_tg_bot-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96015f6c1f2e2894fbbceb6efdef3b1e5e7826cf4a91b2f5fd85a0c44d6170f3
MD5 dd141495c5e588d0dd2f752320423b50
BLAKE2b-256 8dddbf0308fa65bf1e32d2b9c3df7666a2a1e8a7b303d63ec4f401c7792f9b36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page