-
First of all, you need to get token from BotFather.
-
Then create a .env file and put there TOKEN, NAME, PASSWORD and PINCODE, where
NAME is a username from your "mysql database", PASSWORD is a password from your "mysql database" and PINCODE is a pin code for giving rights to an user for mailing.
Format of writing:
TOKEN=tokenname
NAME=name
PASSWORD=hardpass
PINCODE=hardpincode
If you don't know what means a username and password from "mysql database", I recommend you to read this article
- Now, you need to install requirements.
pip install -r requirements.txt
- Run the script named as "database.py". It will create a database for the Telegram bot.
python3 database.py
- Run the script named as "main.py". This is the main script which starts the telegram bot.
python3 main.py
Gratz!
Your bot is working.
If you need to refresh your database, you can repeat previous actions like just run the database.py script.