Auto Postin Bot simplifies the process of reposting messages from source channels to destination channels. Effortlessly share content, updates, and announcements across your Telegram channels with just a few clicks.
This guide will help you set up a Telegram bot using Python and the Telegram Bot API.
Before you begin, make sure you have the following:
- Python installed on your system.
-
Open Telegram and search for "@BotFather" or use this link to open the BotFather chat.
-
Start a chat with BotFather and create a new bot by following the instructions. Once your bot is created, you will receive a token. Copy this token; you'll need it later.
-
Visit the Telegram Apps page and log in with your Telegram account.
-
Enter your phone number and follow the verification process to obtain your App
api_id
andapi_hash
. Also, provide an App title and a Short name.
-
Edit a
.env
file in the root directory of your project and add the following lines, replacing<YOUR_BOT_TOKEN>
,<YOUR_APP_ID>
, and<YOUR_APP_HASH>
with the values you obtained in the previous steps: -
Save the
.env
file.
-
Open your terminal or command prompt.
-
Navigate to the root directory of your project.
-
Run the following command to install all the required dependencies from
requirements.txt
:
pip install -r requirements.txt
-
Open your terminal or command prompt.
-
Navigate to the root directory of your project.
-
Run the following command to start your bot:
python ./bot/main.py
- Enter your phone number and follow the authentication process