-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a45d36f
commit e4f917b
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ temp.info | |
downloads | ||
tron.db | ||
.venv | ||
|
||
installed_dependencies.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,5 @@ main() { | |
install_userbot_dependencies | ||
run_userbot | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
winget install -e --id Python.Python.3.10 | ||
@echo off | ||
setlocal | ||
|
||
:: File containing the list of required packages | ||
set REQUIREMENTS_FILE=requirements.txt | ||
set INSTALLED_FILE=installed_dependencies.txt | ||
|
||
:: Main function | ||
:main | ||
:: Show message | ||
echo Running script, please be patient ... | ||
|
||
:: Check Python 3 installation | ||
echo Checking python installation ... | ||
where python3 >nul 2>&1 | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Python3 is not installed. Trying to install Python3 ... | ||
echo Please install Python3 manually from the Python website or using a package manager. | ||
echo Exiting script with error. | ||
exit /b 1 | ||
) | ||
|
||
:: Check and install userbot dependencies | ||
if not exist "%REQUIREMENTS_FILE%" ( | ||
echo REQUIREMENTS_FILE file not found, Exiting script with error. | ||
exit /b 1 | ||
) | ||
|
||
echo Checking userbot dependencies ... | ||
for /f "usebackq tokens=* delims=" %%i in ("%REQUIREMENTS_FILE%") do ( | ||
:: Skip empty lines and comments | ||
if "%%i"=="" goto :eof | ||
if "%%i"=="REM" goto :eof | ||
|
||
:: Check if the package is installed | ||
pip show %%i >nul 2>&1 | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo %%i is not installed, trying to install ... | ||
pip install %%i | ||
) else ( | ||
echo %%i >> "%INSTALLED_FILE%" | ||
) | ||
) | ||
|
||
:: Run userbot | ||
cls | ||
python3 -m main | ||
echo Configuring Userbot, wait .... | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to run userbot. Exiting script with error. | ||
exit /b 1 | ||
) | ||
endlocal |