๐ Welcome to PowerMet Generators Bot! โฝ๏ธ
PowerMet Generators Bot is your ultimate assistant for selecting the perfect generator to meet your power needs. Whether you're looking for gasoline โฝ๏ธ or diesel โฝ๏ธ generators, we've got you covered. ๐ก๐ Get expert consultation and find the generator that suits your requirements with ease.
Explore our wide range of generators, get personalized recommendations, and make informed decisions. Let us guide you through the world of power solutions. ๐๐ช
Brief overview of your project.
For deployment on Linux operating systems:
-
Install Python 3.x: Python Official Website
-
Clone the repository:
git clone github.com/Saidalo1/power_met_bot
-
Navigate to the project folder:
cd [folder name]
-
Install dependencies:
pip install -r requirements.txt
-
Create a virtual environment (venv):
python -m venv venv
-
Activate the virtual environment:
- On Linux:
source venv/bin/activate
- On Windows:
venv\Scripts\activate
- On Linux:
-
Configure the
.env
file:Create a
.env
file in the project root and add the following:# Telegram Bot Token TOKEN="Your_Telegram_Bot_Token_Here" # Database settings DATABASE_FOLDER='database' DATABASE_NAME='power_met_bot' # Greeting Text GREETING_TEXT="Explanation of the greeting text." # Start Message START_MESSAGE="Explanation of the start message." # Incorrect Selected Language ERROR_LANGUAGE="Explanation of the error message for incorrect language selection." # Locale Directory LOCALE_DIRECTORY="locales" # Group Chat ID GROUP_CHAT_ID=Your_Group_Chat_ID_Here # Generators Per Page GENERATORS_PER_PAGE=20 # Phone Number for order SALES_DP_NUM='Phone Number of manager' # Media Folder Name MEDIA_FOLDER_NAME=\media\ # Generator Photo Name GENERATOR_PHOTO_NAME='generator.png'
-
Run the bot:
python bot.py
To automatically start the bot when your system boots, you can create a systemd service. Here's how:
-
Create a new service file:
sudo nano /etc/systemd/system/your_bot.service
-
Add the following to the file:
[Unit] Description=Your Bot Service After=network.target [Service] User=username WorkingDirectory=/path/to/your/project ExecStart=/usr/bin/python /path/to/your/project/bot.py [Install] WantedBy=multi-user.target
Replace
username
with your username and/path/to/your/project
with the actual path to your project folder. -
Save the file and close the editor.
-
Start the service:
sudo systemctl start your_bot.service
-
Enable the service to start on boot:
sudo systemctl enable your_bot.service
To install and run the bot on a Windows operating system, follow these steps:
- Install Python 3.x: Python Official Website
- Clone the repository:
git clone github.com/Saidalo1/power_met_bot
- Open a command prompt and navigate to the project folder:
cd [folder name]
- Install dependencies:
pip install -r requirements.txt
- Create a virtual environment (venv):
python -m venv venv
- Activate the virtual environment:
venv\Scripts\activate
- Configure the
.env
file: Instructions below - Run the bot:
python bot.py
To automatically start the bot when your system boots, you can create a batch script to activate the virtual environment and then launch the bot:
-
Create a new text file named
start_bot.bat
in the project folder. -
Open the file with a text editor and add the following lines:
@echo off cd /d [path to your project folder] call venv\Scripts\activate python bot.py
-
Save the file.
-
Press
Win + R
, typeshell:startup
, and press Enter. This will open the Startup folder. -
Create a shortcut to the
start_bot.bat
script in the Startup folder.
Instructions on how to configure your bot using the .env
file.
Instructions on how to use your bot.
Information for contributors.
Your project's license information.