ΠΠΎΡ Ρ ΠΊΠ»Π°Π²ΠΈΠ°ΡΡΡΠΎΠΉ , Π΄Π»Ρ ΠΏΡΠΈΡΠΌΠ° Π·Π°ΡΠ²ΠΎΠΊ Π² ΡΠ΅Π»Π΅Π³ΡΠ°ΠΌΠ΅ ΠΈ ΠΎΠ±ΠΎΠ·Π½Π°ΡΠ΅Π½ΠΈΡ ΠΏΡΠ΅Π΄Π²Π°ΡΠΈΡΠ΅Π»ΡΠ½ΠΎΠΉ ΡΡΠΎΠΈΠΌΠΎΡΡΠΈ ΡΡΠ»ΡΠ³. ΠΠ°Π½Π½ΡΠ΅ Π·Π°ΠΏΠΈΡΡΠ²Π°Π΅ΠΌ Π² ΠΠ SQLite. A bot with a keyboard for accepting applications in telegram and indicating the preliminary cost of services. We write the data to the SQLite database.
Π² ΡΠ°ΠΉΠ»Π΅ markups.py ΠΎΠ±ΡΡΠ²Π»Π΅Π½Ρ Π²ΡΠ΅ ΠΊΠ»Π°Π²ΠΈΠ°ΡΡΡΡ Π΄Π»Ρ ΡΠ΄ΠΎΠ±ΡΡΠ²Π° ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΡ Π±ΠΎΡΠ°. ΠΠΎΠ³ΠΈΠΊΠ° Π±ΠΎΡΠ° ΠΈ ΠΊΠΎΠ΄ Π² main.py
Π config.py Π»Π΅ΠΆΠΈΡ ΡΠΎΠΊΠ΅Π½ Π±ΠΎΡΠ°
Π intro_text.py Π²Π²ΠΎΠ΄Π½ΡΠΉ ΡΠ΅ΠΊΡΡ
Π title.jpg Π½Π°ΡΠ°Π»ΡΠ½Π°Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ°
all keyboards are declared in the markups.py file for the convenience of expanding the bot. Bot logic and code in main.py
In config.py there is a bot token
In intro_text.py introductory text
In title.jpg initial picture
Python 3.X
ΠΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ Π²ΠΈΡΡΡΠ°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΠ΅:
python -m venv venv
ΠΠ½Π°ΡΠ΅ ΠΌΠΎΠ³ΡΡ Π±ΡΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ, Π΅ΡΠ»ΠΈ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Ρ Π΄ΡΡΠ³ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ»ΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ ΠΎΡ telethon, Telegrambotapi ΠΈ ΠΏΡ.
ΠΠ°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ Π² Π² ΡΠ°ΠΉΠ»Π΅ requirements.txt,ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Ρ ΠΌΠΎΠΌΠΎΡΡΡ pip:
pip install -r requirements.txt
Python 3.X
Be sure to install the virtual environment:
python -m venv venv
Otherwise, there may be problems if other versions or libraries from telethon, Telegrambotapi, etc. are installed.
Dependencies in the req.txt file can be installed using pip:
pip install -r req.txt
-
Π ΡΠ°ΠΉΠ»Π΅ config.py ΠΏΡΠΎΠΏΠΈΡΡΠ²Π°Π΅ΠΌ ΡΠΎΠΊΠ΅Π½ Π±ΠΎΡΠ° (Π²Π·ΡΡΡ ΠΌΠΎΠΆΠ½ΠΎ Π² BotFather)
-
ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ
python main.py
-
In the config.py file we register the bot token (you can get it in BotFather)
-
Run
python main.py