Sending Messages Bot is a powerful tool that allows you to send messages to different users directly from a database, all managed through another Telegram bot. With seamless integration and efficient message distribution, it simplifies communication with your audience.
This guide will help you set up both a Telegram Manager and a Spam Bot using Python and the Telegram Bot API.
-
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.
-
Open the
.env
file in the root directory of your project. -
Modify the
.env
file, replacing<MANAGER_APP_ID>
,<MANAGER_API_HASH>
,<MANAGER_BOT_TOKEN>
and<MANAGER_BOT_USERNAME>
with the values you obtained in the previous steps: -
Save the
.env
file.
- Log in to the Telegram account that you want to use for the Spam Bot.
-
Visit the Telegram Apps page and log in with your Telegram account.
-
Enter your phone number and follow the verification process to obtain your Spam Bot's App
api_id
andapi_hash
. Provide an App title and Short name as well.
-
Open the
.env
file in the root directory of your project. -
Modify the
.env
file to include the API credentials for the Spam Bot. ReplaceSPAM_BOT_USERNAME
,<SPAM_BOT_APP_ID>
, and<SPAM_BOT_API_HASH>
with the values obtained for the Spam Bot -
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 the Manager Bot:
py ./services/manager/manager.py
-
Open your terminal or command prompt.
-
Navigate to the root directory of your project.
-
Run the following command to start the Spam Bot:
py ./services/spambot/spam_bot.py
- Enter the phone number associated with the Spam Bot account and complete the authentication process.