Skip to content

template for telegram bot made using pyrogram

License

Notifications You must be signed in to change notification settings

JuvenileLad/Telegram_bot_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Bot using Pyrogram Template

This is a template for creating a Telegram bot using the Pyrogram library in Python. Pyrogram is a powerful and asynchoronous library for building Telegram bots.

Open Source Love svg1 GPLv3 license

Prequisites

This is not a beginner's guide to making telegram bots. Beginner to Intermediate familiarity with Python3.6+ is recommended.

Obtain all the required API credentials

Configuration

copy the contents of config.env_example to a new file config.env by using the following command:

Windows

copy config.env_example config.env

Linux/maxOS (Unix-like systems)

cp config.env_example config.env

or you can just rename config.env_example to config.env. After that, edit the config.env file and replace the values as follows:

(do not add quotes(" ") symbol in any value)

  • in TELEGRAM_SESSION_NAME enter whatever you want as session name in telegram
  • enter telegram API Hash in TELEGRAM_API_HASH & API ID in TELEGRAM_API_ID
  • enter telegram bot token in TELEGRAM_BOT_TOKEN
  • the VERSION could be anything. It will be printed in the console whenever the bot is deployed.

Installation

  1. Clone this repository to your local machine:
git clone https://github.com/JuvenileLad/Telegram_bot_template.git
  1. Change to the project directory:
cd Telegram_bot_template
  1. Install the required Python packages using pip:
pip install -r requirements.txt
  1. Run the bot:
python3 -m app_name

change all instaces of app_name to the name of your project/bot.

Usage

  • Start a chat with your bot on Telegram and send it /start command to interact with it.

Bot Development

You can start building your bot by customizing the app_name/core/main.py file. Pyrogram provides a comprehensive API to interact with Telegram's Bot API, allowing you to handle messages, send replies, and perform various actions. This template follows a modular system in which the utility modules would be inside the app_name/utils folder. There is also a separate folder for database related modules in app_name/db. A plugins folder can also be added if the need arises.

Resources

Contributing

Contributions are welcome! If you'd like to contribute to this template or report issues, please create a pull request or open an issue on the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Note: This is a basic template to help you get started with building a Telegram bot using Pyrogram. Be sure to explore Pyrogram's documentation and Telegram's Bot API documentation for more advanced features and capabilities.

About

template for telegram bot made using pyrogram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published