-
Notifications
You must be signed in to change notification settings - Fork 39
/
termux-install.sh
153 lines (121 loc) · 3.99 KB
/
termux-install.sh
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
if ! command -v termux-setup-storage; then
echo This script can be executed only on Termux
exit 1
fi
termux-wake-lock
pkg update -y && pkg upgrade -y
pkg install python3 git clang ffmpeg wget libjpeg-turbo libcrypt ndk-sysroot zlib openssl -y || exit 2
LDFLAGS="-L${PREFIX}/lib/" CFLAGS="-I${PREFIX}/include/" pip3 install --upgrade wheel pillow
if [[ -d "Moon-Userbot" ]]; then
cd Moon-Userbot
elif [[ -f ".env.dist" ]] && [[ -f "main.py" ]] && [[ -d "modules" ]]; then
:
else
git clone https://github.com/The-MoonTg-project/Moon-Userbot || exit 2
cd Moon-Userbot || exit 2
fi
if [[ -f ".env" ]] && [[ -f "my_account.session" ]]; then
echo "It seems that Moon-Userbot is already installed. Exiting..."
exit
fi
python3 -m pip install -U -r requirements.txt || exit 2
echo
echo "Enter API_ID and API_HASH"
echo "You can get it here -> https://my.telegram.org/apps"
echo "Leave empty to use defaults (please note that default keys significantly increases your ban chances)"
read -r -p "API_ID > " api_id
if [[ $api_id = "" ]]; then
api_id="2040"
api_hash="b18441a1ff607e10a989891a5462e627"
else
read -r -p "API_HASH > " api_hash
fi
echo
echo "SET PM PERMIT warn limit"
read -r -p "PM_LIMIT warn limit > " pm_limit
if [[ $pm_limit = "" ]]; then
pm_limit="3"
echo "limit not provided by user set to default"
fi
echo
echo "Enter APIFLASH_KEY for webshot plugin"
echo "You can get it here -> https://apiflash.com/dashboard/access_keys"
read -r -p "APIFLASH_KEY > " apiflash_key
if [[ $apiflash_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use .webshot plugin"
fi
echo
echo "Enter RMBG_KEY for remove background module"
echo "You can get it here -> https://www.remove.bg/dashboard#api-key"
read -r -p "RMBG_KEY > " rmbg_key
if [[ $rmbg_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use remove background modules"
fi
echo
echo "Enter GEMINI_KEY if you want to use AI"
echo "NOTE: Don't Use unless you've enough storage in your device"
echo "MIN. REQ. STORAGE: 128GB"
echo "You can get it here -> https://makersuite.google.com/app/apikey"
read -r -p "GEMINI_KEY > " gemini_key
if [[ $gemini_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use Gemini AI modules"
fi
echo
echo "Enter COHERE_KEY if you want to use AI"
echo "You can get it here -> https://dashboard.cohere.com/api-keys"
read -r -p "COHERE_KEY > " cohere_key
if [[ $cohere_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use Coral AI modules"
fi
echo
echo "Enter VT_KEY for VirusTotal"
echo "You can get it here -> https://www.virustotal.com/"
read -r -p "VT_KEY > " vt_key
if [[ $vt_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use VirusTotal module"
fi
echo
echo "Enter VCA_API_KEY for aiutils"
echo "Learn How to Get One --> https://github.com/VisionCraft-org/VisionCraft?tab=readme-ov-file#obtaining-an-api-key"
read -r -p "VCA_API_KEY > " vca_api_key
if [[ $vca_api_key = "" ]]; then
echo "NOTE: API Not set you'll not be able to use aiutils module/pligins"
fi
echo "Choose database type:"
echo "[1] MongoDB (your url)"
echo "[2] Sqlite"
read -r -p "> " db_type
if [[ $db_type = 1 ]]; then
echo "Please enter db_url"
echo "You can get it here -> https://telegra.ph/How-to-get-Mongodb-URL-and-login-in-telegram-08-01"
read -r -p "> " db_url
db_name=Moon_Userbot
db_type=mongodb
else
db_name=db.sqlite3
db_type=sqlite3
fi
cat > .env << EOL
API_ID=${api_id}
API_HASH=${api_hash}
STRINGSESSION=
# sqlite/sqlite3 or mongo/mongodb
DATABASE_TYPE=${db_type}
# file name for sqlite3, database name for mongodb
DATABASE_NAME=${db_name}
# only for mongodb
DATABASE_URL=${db_url}
APIFLASH_KEY=${apiflash_key}
RMBG_KEY=${rmbg_key}
VT_KEY=${vt_key}
GEMINI_KEY=${gemini_key}
COHERE_KEY=${cohere_key}
VCA_API_KEY=${vca_api_key}
PM_LIMIT=${pm_limit}
EOL
python3 install.py 3 || exit 3
echo
echo "============================"
echo "Great! Moon-Userbot installed successfully!"
echo "Start with: \"cd Moon-Userbot && python3 main.py\""
echo "============================"