-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bat
90 lines (88 loc) · 2.63 KB
/
run.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
SET root=%~dp0
CD /D %root%
SETLOCAL EnableDelayedExpansion
for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set BRANCH=%%i
python -V >nul 2>&1 || goto :python
if not exist .git\ (
echo This seems to be your first run. The setup will now proceed to download all required files. They will be downloaded to the same location as where this run.bat file is.
pause
git init . >nul || goto :git
git remote add origin https://github.com/appu1232/Discord-Selfbot.git >nul 2>&1
git fetch --all
git reset --hard origin/master
)
git fetch origin master >nul 2>&1
git remote show origin > tmp.txt
set findfile="tmp.txt"
set findtext="up"
findstr %findtext% %findfile% >nul 2>&1
if errorlevel 1 goto forward
goto run
:prompt
choice /t 10 /c yn /d n /m "There is an update for the bot. Download now?"
if errorlevel 2 goto :run
if errorlevel 1 goto :update
:forward
set findfile="tmp.txt"
set forwardable="fast-forwardable"
findstr %forwardable% %findfile% >nul 2>&1
if errorlevel 1 goto prompt
goto run
:update
echo Starting update...
echo Backing up your settings...
echo d | xcopy settings settings_backup /E >nul
echo Latest update:
git --no-pager log --pretty=oneline -n1 origin/%BRANCH% ^%BRANCH%
git pull origin %BRANCH%
if errorlevel 1 goto force
echo Finished updating
echo Starting up...
goto run
:force
git fetch --all
git reset --hard origin/%BRANCH%
echo Finished updating
echo Starting up...
goto run
:git
TITLE Error!
echo Git not found, Download here: https://git-scm.com/downloads
echo Press any key to exit.
pause >nul
CD /D "%root%"
goto :EOF
:python
TITLE Error!
echo Python not added to PATH or not installed. Download Python 3.5.2 or above and make sure you add to PATH: https://i.imgur.com/KXgMcOK.png
echo Press any key to exit.
pause >nul
CD /D "%root%"
goto :EOF
:run
if exist tmp.txt del tmp.txt
FOR /f %%p in ('where python') do SET PYTHONPATH=%%p
echo Checking/Installing requirements (takes some time on first install)...
chcp 65001 >nul
set PYTHONIOENCODING=utf-8
python -m pip install --user --upgrade pip >nul
python -m pip install --user -r requirements.txt
if errorlevel 1 (
echo Requirements installation failed. Perhaps some dependency is missing or access was denied? Possible solutions:
echo - Run as administrator
echo - Google the error
echo - Visit the Discord server for help
echo Press any key to exit.
set /p input=
exit
)
ping 127.0.0.1 -n 2 > nul
cls
type cogs\utils\credit.txt
echo[
echo[
echo Requirements satisfied.
echo Starting the bot (this may take a minute or two)...
python loopself.py
if %ERRORLEVEL% == 15 goto update