intBOT.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. #!/bin/bash
  2. [[ -e /bin/ejecutar/msg ]] && source /bin/ejecutar/msg || source <(curl -sSL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/msg-bar/msg)
  3. bar="$(msg -bar3)"
  4. [[ -e /etc/systemd/system/btkill.service ]] && systemctl restart btkill.service &>/dev/null
  5. tr=${id}
  6. ofus () {
  7. unset txtofus
  8. number=$(expr length $1)
  9. for((i=1; i<$number+1; i++)); do
  10. txt[$i]=$(echo "$1" | cut -b $i)
  11. case ${txt[$i]} in
  12. ".")txt[$i]="x";;
  13. "x")txt[$i]=".";;
  14. "5")txt[$i]="s";;
  15. "s")txt[$i]="5";;
  16. "1")txt[$i]="@";;
  17. "@")txt[$i]="1";;
  18. "2")txt[$i]="?";;
  19. "?")txt[$i]="2";;
  20. "4")txt[$i]="0";;
  21. "0")txt[$i]="4";;
  22. "/")txt[$i]="K";;
  23. "K")txt[$i]="/";;
  24. esac
  25. txtofus+="${txt[$i]}"
  26. done
  27. echo "$txtofus" | rev
  28. }
  29. # SISTEMA DE SELECAO
  30. selection_fun () {
  31. local selection="null"
  32. local range
  33. for((i=0; i<=$1; i++)); do range[$i]="$i "; done
  34. while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
  35. echo -ne "\033[1;37mOpcion: " >&2
  36. read selection
  37. tput cuu1 >&2 && tput dl1 >&2
  38. done
  39. echo $selection
  40. }
  41. check_ip () {
  42. MIP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
  43. MIP2=$(wget -qO- ipv4.icanhazip.com)
  44. [[ "$MIP" != "$MIP2" ]] && IP="$MIP2" || IP="$MIP"
  45. echo "$IP" > /usr/bin/vendor_code
  46. }
  47. function_verify () {
  48. unset keybot
  49. echo -e "\033[7;49;35m =====>>►► 🐲 GEN ChumoGH${TTcent}VPS 🐲 ◄◄<<===== \033[0m"
  50. msg -bar
  51. [[ "$(echo "$(cat < /etc/nivbot)")" -ge "5" ]] && {
  52. [[ -e /bin/downloadbot ]] && {
  53. [[ -z $(cat < /bin/downloadbot) ]] && read -p " Ingresa tu Key de Autorizacion : " keybot || unset keybot
  54. } || read -p " Key de Autorizacion : " keybot
  55. } || read -p " Key de Autorizacion : " keybot
  56. [[ -z $keybot ]] && {
  57. rm -f /bin/downloadbot
  58. [[ -e /bin/downloadbot ]] && link="$(cat < /bin/downloadbot)" || link='https://raw.githubusercontent.com'
  59. permited=$(curl -sSL "${link}/ChumoGH/VPSbot/main/TeleBotGen/Control/Control-Bot")
  60. } || {
  61. permited=$(curl -sSL "$(ofus $keybot)/ChumoGH/VPSbot/main/TeleBotGen/Control/Control-Bot")
  62. }
  63. [[ $(echo $permited|grep "${IP}") = "" ]] && {
  64. clear
  65. echo -e "\n\n\n\e[31m====================================================="
  66. echo -e "\e[31m ¡LA IP $(wget -qO- ipv4.icanhazip.com) FUE RECHAZADA!"
  67. echo -e " $link No AUTORIZADA el ACCESO "
  68. echo -e " SI DESEAS USAR EL BOTGEN CONTACTE A @ChumoGH"
  69. echo -e "\e[31m=====================================================\n\n\n\e[0m"
  70. [[ -e "/bin/ShellBot.sh" ]] && rm -f /bin/ShellBot.sh
  71. exit 1
  72. } || {
  73. ### INTALAR VERCION DE SCRIPT
  74. clear
  75. echo -e "\n\n\n\e[32m====================================================="
  76. echo -e "\e[32m ¡LA IP $(wget -qO- ipv4.icanhazip.com) ESTA AUTORIZADA!"
  77. echo -e " Mediante $link Autorida por @ChumoGH"
  78. echo -e " SI DESEAS USAR EL BOTGEN CONTACTE A @ChumoGH"
  79. echo -e "\e[32m=====================================================\n\n\n\e[0m"
  80. CIDdir=/etc/ADM-db && [[ ! -d ${CIDdir} ]] && mkdir ${CIDdir}
  81. [[ -e /etc/nivbot ]] && {
  82. i=$(cat < /etc/nivbot)
  83. lv=$(($i+1))
  84. echo $lv > /etc/nivbot
  85. } || echo "1" > /etc/nivbot
  86. v1=$(curl -sSL "https://www.dropbox.com/s/8tizr516cvkwss6/v-new.log")
  87. echo "$v1" > /etc/ADM-db/vercion
  88. }
  89. }
  90. edit_cost () {
  91. msg -bar
  92. echo -e "\033[1;37mRECUERDA EDITAR LOS COSTOS O TIEMPOS\n Para Salir Ctrl + C o 0 Para Regresar\033[1;33m"
  93. echo -e " \033[1;31m[ !!! ]\033[1;33m RECUERDA, UNA VEZ EDITADO NO PODRAS VOLVER A \n TENER EL ORIGINAL, A MENOS QUE REINSTALES \033[1;31m\033[1;33m"
  94. msg -bar
  95. echo -e " \033[1;31mLuego de editar Presiona Ctrl + O y Enter \033[1;33m \033[1;31m\033[1;33m"
  96. echo -e " \033[1;31m Por Ultimo Ctrl + X \033[1;33m \033[1;31m\033[1;33m"
  97. echo -ne "\033[1;37m"
  98. read -p " Presiona Enter para Continuar "
  99. nano /etc/ADM-db/sources/costes
  100. systemctl restart BotGen-server &>/dev/null
  101. echo -e " MODIFICADO EXITOSAMENTE"
  102. bot_gen
  103. }
  104. change_pay () {
  105. unset option
  106. clear
  107. echo -e "$bar"
  108. echo -e " MENSAJE ACTUAL $(cat < /etc/mpayu)"
  109. echo -e "$bar"
  110. echo -e " \033[1;37mINGRESA TU METODO DE PAGO Y/O CORREO"
  111. echo -e "$bar\n"
  112. echo -e "Ingresa en este Orden o Secuencia \n PAYPAL : chumogh@gmail.com \n"
  113. echo -e "$bar"
  114. read -p "TEXTO: " opcion
  115. [[ -z $opcion ]] && bot_gen && exit || echo "$opcion" > /etc/mpayu && echo "TOKEN APLICADO EXITOSAMENTE"
  116. read -p " Enter para Continuar"
  117. echo -e "$bar"
  118. echo -e " \033[1;37m NUMERO DE CONTACTO ACTUAL $(cat < /etc/numctc) "
  119. echo -e "$bar\n"
  120. echo -e " Ingresa en este Orden o FORMATO \n 593987072611 \n"
  121. echo -e "$bar"
  122. read -p "TEXTO: " opcion1
  123. opcion1="$(echo -e "$opcion1" | sed -e 's/[^0-9]//ig')"
  124. [[ -z $opcion ]] && return || {
  125. echo -e "$opcion1" > /etc/numctc
  126. chmod +x /etc/numctc
  127. echo "TOKEN APLICADO EXITOSAMENTE"
  128. systemctl restart BotGen-server &>/dev/null
  129. }
  130. echo -e "$bar\n"
  131. echo -e " AGREGA NUEVO URL DE CATALOGO / OPCIONAL \n https://shoppy.gg/@ChumoGH/ \n"
  132. echo -e "$bar"
  133. read -p "TEXTO: " nmsg
  134. [[ -z $nmsg ]] && return || {
  135. echo -e "$nmsg" > /etc/urlCT
  136. chmod +x /etc/urlCT
  137. echo "URL APLICADO EXITOSAMENTE"
  138. systemctl restart BotGen-server &>/dev/null
  139. }
  140. echo -e "$bar\n"
  141. echo -e " AGREGA NUEVO ENLACE PARA DONACIONES / OPCIONAL \n https://www.paypal.com/paypalme/ChumoGH \n"
  142. echo -e "$bar"
  143. read -p "TEXTO: " donat
  144. [[ -z $donat ]] && return || {
  145. echo -e "$donat" > /etc/urlDN
  146. chmod +x /etc/urlDN
  147. echo "URL APLICADO EXITOSAMENTE"
  148. systemctl restart BotGen-server &>/dev/null
  149. }
  150. read -p " Enter para Continuar"
  151. systemctl restart BotGen-server &>/dev/null
  152. bot_gen
  153. }
  154. lim-bot () {
  155. unset option
  156. clear
  157. echo -e "$bar"
  158. echo -e " \033[1;37mIngrese el Limite del Bot"
  159. echo -e "$bar"
  160. echo -n "Limite: "
  161. read opcion
  162. echo "$opcion" > ${CIDdir}/limit
  163. echo "$opcion" > /etc/limit
  164. unset PIDGEN
  165. PIDGEN=$(ps aux|grep -v grep|grep "kill_drop.sh")
  166. if [[ ! $PIDGEN ]]; then
  167. msg -bar
  168. echo -ne "\033[1;97m Poner en linea KILL ID [s/n]: "
  169. read bot_ini
  170. msg -bar
  171. [[ $bot_ini = @(s|S|y|Y) ]] && {
  172. echo -e "[Unit]
  173. Description=BotGen Service by @ChumoGH
  174. After=network.target
  175. StartLimitIntervalSec=0
  176. [Service]
  177. Type=simple
  178. User=root
  179. WorkingDirectory=/root
  180. ExecStart=/bin/bash /etc/ADM-db/sources/kill_drop.sh
  181. Restart=always
  182. RestartSec=60s
  183. [Install]
  184. WantedBy=multi-user.target" > /etc/systemd/system/btkill.service
  185. systemctl enable btkill &>/dev/null
  186. systemctl start btkill &>/dev/null
  187. msg -bar
  188. echo -e "\033[1;31m Bot ID KILL ACTIVADO"
  189. msg -bar
  190. }
  191. else
  192. killall kill_drop.sh &>/dev/null
  193. systemctl stop btkill &>/dev/null
  194. systemctl disable btkill &>/dev/null
  195. rm /etc/systemd/system/btkill.service &>/dev/null
  196. clear
  197. msg -bar
  198. echo -e "\033[1;31m Bot ID KILL fuera de linea"
  199. msg -bar
  200. fi
  201. read -p "Presione Enter para continuar "
  202. bot_gen
  203. #echo "sed -i "s/1001282138571/0/g" /etc/gerar-sh-log
  204. #echo '#!/bin/bash -e
  205. #sleep 24h' > ${CIDdir}/sumlimit
  206. #echo 'newq=$(cat < /etc/ADM-db/limit)
  207. #opcion=$(cat < /etc/limit)
  208. #newsum=$(($newq + $opcion))
  209. #echo "$newsum" > /etc/ADM-db/limit
  210. #screen -dmS sumlimit bash /etc/ADM-db/sumlimit&
  211. #exit' >> ${CIDdir}/sumlimit
  212. #echo -e "$bar"
  213. #read -p "Presione Enter para continuar "
  214. #screen -dmS sumlimit bash /etc/ADM-db/sumlimit&
  215. #bot_gen
  216. }
  217. veryfy_fun () {
  218. SRC="/etc/ADM-db/sources" && [[ ! -d ${SRC} ]] && mkdir ${SRC}
  219. unset ARQ
  220. case $1 in
  221. "BotGen.sh")ARQ="/etc/ADM-db/";;
  222. *)ARQ="/etc/ADM-db/sources/";;
  223. esac
  224. mv -f $HOME/update/$1 ${ARQ}/$1 && echo -e "\033[1;31m- \033[1;32mRecibido!" || echo -e "\033[1;31m- \033[1;31mFalla (no recibido!)"
  225. chmod +x ${ARQ}/$1
  226. }
  227. download () {
  228. clear
  229. msg -bar
  230. echo -e "\033[1;33mDescargando archivos... ESPERE "
  231. msg -bar
  232. wget -q --no-check-certificate -O $HOME/files.tar https://www.dropbox.com/s/pf3b054mts3zrj6/files.tar
  233. [[ -d $HOME/update ]] && rm -rf $HOME/update/* || mkdir $HOME/update
  234. [[ -e $HOME/files.tar ]] && tar xpf $HOME/files.tar -C $HOME/update && rm -f $HOME/files.tar
  235. echo 999 > ${CIDdir}/limit
  236. n=1
  237. for arqx in `ls $HOME/update`; do
  238. echo -ne "\033[1;33mFichero \033[1;31m[${n}.bot] "
  239. [[ -e $HOME/update/$arqx ]] && veryfy_fun $arqx
  240. n=$(($n + 1))
  241. done
  242. cd $HOME && rm -rf $HOME/update && rm -f $HOME/files.tar
  243. echo -ne "\033[1;31m[ ! ] RESTAUDANDO ADMINISTRADOR "
  244. (
  245. [[ -e $HOME/costes ]] && mv $HOME/costes /etc/ADM-db/sources/costes
  246. [[ -e $HOME/token ]] && mv $HOME/token /etc/ADM-db/token
  247. [[ -e $HOME/resell ]] && mv $HOME/resell /etc/ADM-db/resell
  248. [[ -e $HOME/Admin-ID ]] && mv $HOME/Admin-ID /etc/ADM-db/Admin-ID
  249. [[ -e $HOME/User-ID ]] && mv $HOME/User-ID /etc/ADM-db/User-ID
  250. [[ -e $HOME/ress ]] && mv $HOME/ress /etc/ADM-db/ress
  251. [[ -e $HOME/limit ]] && mv $HOME/limit /etc/ADM-db/limit
  252. [[ -e $HOME/num-key.cont ]] && mv $HOME/num-key.cont /etc/ADM-db/num-key.cont
  253. ) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  254. [[ ! -e ${CIDdir}/resell ]] && echo "@ChumoGH" > ${CIDdir}/resell
  255. [[ ! -e $(cat < /etc/mpayu) ]] && echo "Paypal : chumogh@outlook.com" > /etc/mpayu && echo "593987072611" > /etc/numctc
  256. rm $HOME/lista-arq
  257. systemctl restart BotGen-server &>/dev/null
  258. bot_gen
  259. }
  260. ini_token () {
  261. clear
  262. echo -e "$bar"
  263. echo -e " \033[1;37mIngrese el token de su bot"
  264. echo -e "$bar"
  265. echo -n "TOKEN: "
  266. read opcion
  267. echo "$opcion" > ${CIDdir}/token
  268. echo -e "$bar"
  269. echo -e " \033[1;32mtoken se guardo con exito!" && echo -e "$bar" && echo -e " \033[1;37mPara tener acceso a todos los comandos del bot\n deve iniciar el bot en la opcion 2.\n desde su apps (telegram). ingresar al bot!\n digite el comando \033[1;31m/id\n \033[1;37mel bot le respodera con su ID de telegram.\n copiar el ID e ingresar el mismo en la opcion 3" && echo -e "$bar"
  270. read -p "Presione Enter para continuar "
  271. bot_gen
  272. }
  273. ini_res () {
  274. clear
  275. echo -e "$bar"
  276. echo -e " \033[1;37mIngrese el Contacto de ADMIN de su bot"
  277. echo -e "$bar"
  278. echo -n "RESELLER: "
  279. read opction
  280. echo "$opction" > ${CIDdir}/resell
  281. echo -e "$bar"
  282. read -p "Presione Enter para continuar "
  283. bot_gen
  284. }
  285. ini_id () {
  286. clear
  287. echo -e "$bar"
  288. echo -e " \033[1;37mIngrese su ID de telegram"
  289. echo -e "$bar"
  290. echo -n "ID: "
  291. read opcion
  292. echo "$opcion" > ${CIDdir}/Admin-ID
  293. echo -e "$bar"
  294. echo -e " \033[1;32mID guardo con exito!" && echo -e "$bar" && echo -e " \033[1;37mdesde su apps (telegram). ingresar al bot!\n digite el comando \033[1;31m/menu\n \033[1;37mprueve si tiene acceso al menu extendido." && echo -e "$bar"
  295. read -p "Presione Enter para continuar "
  296. bot_gen
  297. }
  298. start_bot () {
  299. [[ ! -e "${CIDdir}/token" ]] && echo "null" > ${CIDdir}/token
  300. unset PIDGEN
  301. PIDGEN=$(ps aux|grep -v grep|grep "BotGen.sh")
  302. if [[ ! $PIDGEN ]]; then
  303. echo -e "[Unit]
  304. Description=BotGen Service by @ChumoGH
  305. After=network.target
  306. StartLimitIntervalSec=0
  307. [Service]
  308. Type=simple
  309. User=root
  310. WorkingDirectory=/root
  311. ExecStart=/bin/bash ${CIDdir}/BotGen.sh -start
  312. Restart=always
  313. RestartSec=3s
  314. [Install]
  315. WantedBy=multi-user.target" > /etc/systemd/system/BotGen-server.service
  316. systemctl enable BotGen-server &>/dev/null
  317. systemctl start BotGen-server &>/dev/null
  318. else
  319. killall BotGen.sh &>/dev/null
  320. systemctl stop BotGen-server &>/dev/null
  321. systemctl disable BotGen-server &>/dev/null
  322. rm /etc/systemd/system/BotGen-server.service &>/dev/null
  323. clear
  324. msg -bar
  325. echo -e "\033[1;31m BotGen fuera de linea"
  326. msg -bar
  327. read -p "Presione Enter para continuar "
  328. fi
  329. bot_gen
  330. }
  331. ayuda_fun () {
  332. clear
  333. echo -e "$bar"
  334. echo -e " \e[47m\e[30m Instrucciones rapidas \e[0m"
  335. echo -e "$bar"
  336. echo -e "\033[1;37m Es necesario crear un bot en \033[1;32m@BotFather "
  337. echo -e "$bar"
  338. echo -e "\033[1;32m1- \033[1;37mEn su apps telegram ingrese a @BotFather"
  339. echo -e "\033[1;32m2- \033[1;37mDigite el comando \033[1;31m/newbot"
  340. echo -e "\033[1;32m3- @BotFather \033[1;37msolicitara que\n asigne un nombre a su bot"
  341. echo -e "\033[1;32m4- @BotFather \033[1;37msolicitara que asigne otro nombre,\n esta vez deve finalizar en bot eje: \033[1;31mXXX_bot"
  342. echo -e "\033[1;32m5- \033[1;37mObtener token del bot creado.\n En \033[1;32m@BotFather \033[1;37mdigite el comando \033[1;31m/token\n \033[1;37mseleccione el bot y copie el token."
  343. echo -e "\033[1;32m6- \033[1;37mIngrese el token\n en la opcion \033[1;32m[1] \033[1;31m> \033[1;37mTOKEN DEL BOT"
  344. echo -e "\033[1;32m7- \033[1;37mPoner en linea el bot\n en la opcion \033[1;32m[2] \033[1;31m> \033[1;37mINICIAR/PARAR BOT"
  345. echo -e "\033[1;32m8- \033[1;37mEn su apps telegram, inicie el bot creado\n digite el comando \033[1;31m/id \033[1;37mel bot le respondera\n con su ID de telegran (copie el ID)"
  346. echo -e "\033[1;32m9- \033[1;37mIngrese el ID en la\n opcion \033[1;32m[3] \033[1;31m> \033[1;37mID DE USUARIO TELEGRAM"
  347. echo -e "\033[1;32m10-\033[1;37mcomprueve que tiene acceso a\n las opciones avanzadas de su bot."
  348. echo -e "$bar"
  349. read -p "Presione Enter para continuar "
  350. bot_gen
  351. }
  352. bot_conf () {
  353. [[ -e /etc/ADM-db/token ]] && mv /etc/ADM-db/token /root/token
  354. [[ -e /etc/ADM-db/Admin-ID ]] && mv /etc/ADM-db/Admin-ID /root/Admin-ID
  355. check_ip
  356. function_verify
  357. instaled=/etc/ADM-db/sources && [[ ! -d ${instaled} ]] && download
  358. }
  359. msj_prueba () {
  360. TOKEN="$(cat /etc/ADM-db/token)"
  361. ID="$(cat /etc/ADM-db/Admin-ID)"
  362. [[ -z $TOKEN ]] && {
  363. clear
  364. echo -e "$bar"
  365. echo -e "\033[1;37m Aun no a ingresado el token\n No se puede enviar ningun mensaje!"
  366. echo -e "$bar"
  367. read foo
  368. } || {
  369. [[ -z $ID ]] && {
  370. clear
  371. echo -e "$bar"
  372. echo -e "\033[1;37m Aun no a ingresado el ID\n No se puede enviar ningun mensaje!"
  373. echo -e "$bar"
  374. read foo
  375. } || {
  376. MENSAJE="---------📩𝙈𝙀𝙉𝙎𝘼𝙅𝙀 𝙍𝙀𝘾𝙄𝘽𝙄𝘿𝙊📩--------\n"
  377. MENSAJE+="Esto es un mesaje de prueba!\n"
  378. MENSAJE+="$bar\n"
  379. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  380. curl -s -X POST $URL -d chat_id=$ID -d text="$MENSAJE" &>/dev/null
  381. clear
  382. echo -e "---------📩𝙈𝙀𝙉𝙎𝘼𝙅𝙀 𝙍𝙀𝘾𝙄𝘽𝙄𝘿𝙊📩--------\n"
  383. echo -e "\033[1;37m Mensaje enviado Exitosamente...!"
  384. echo -e "$bar"
  385. sleep 3s
  386. }
  387. }
  388. bot_gen
  389. }
  390. addnewmss() {
  391. unset yesno
  392. unset dnew
  393. let foc++
  394. echo -e "$bar"
  395. echo -e " \033[1;37mINGRESA EL MENSAJE A ENVIAR"
  396. echo -e "$bar"
  397. read -p " $foc TEXTO: " addmss
  398. MSS+="$addmss\n"
  399. echo -e "${cor[3]} ¿DESEAS AÑADIR OTRO SMS ? "
  400. read -p " [S/N]: " -e -i s sshsn
  401. tput cuu1 && tput dl1
  402. tput cuu1 && tput dl1
  403. [[ "$sshsn" = @(s|S|y|Y) ]] && addnewmss
  404. }
  405. msj_ind () {
  406. foc=1
  407. TOKEN="$(cat /etc/ADM-db/token)"
  408. echo -e "$bar"
  409. echo -e " \033[1;37mIngrese su ID de telegram a Mensajear"
  410. echo -e "$bar"
  411. read -p "ID: " ID
  412. [[ -z $ID ]] && ID="$(cat /etc/ADM-db/Admin-ID)"
  413. [[ -z $TOKEN ]] && {
  414. clear
  415. echo -e "$bar"
  416. echo -e "\033[1;37m Aun no a ingresado el token\n No se puede enviar ningun mensaje!"
  417. echo -e "$bar"
  418. read foo
  419. } || {
  420. [[ -z $ID ]] && {
  421. clear
  422. echo -e "$bar"
  423. echo -e "\033[1;37m Aun no a ingresado el ID\n No se puede enviar ningun mensaje!"
  424. echo -e "$bar"
  425. read foo
  426. } || {
  427. MENSAJE="Hola, Mensale de Prueba del BotGen Generador!"
  428. echo -e "$bar"
  429. echo -e " \033[1;37mINGRESA EL MENSAJE A ENVIAR"
  430. echo -e "$bar"
  431. read -p " $foc TEXTO: " addmss
  432. MSS+="$addmss\n"
  433. echo -e "${cor[3]} ¿DESEAS AÑADIR OTRO SMS ? "
  434. read -p " [S/N]: " -e -i s sshsn
  435. tput cuu1 && tput dl1
  436. tput cuu1 && tput dl1
  437. [[ "$sshsn" = @(s|S|y|Y) ]] && addnewmss
  438. MENSAJE=' ---------📩𝙈𝙀𝙉𝙎𝘼𝙅𝙀 𝙍𝙀𝘾𝙄𝘽𝙄𝘿𝙊📩--------\n'
  439. MENSAJE+="$MSS \n "
  440. echo -e "$bar"
  441. echo -e " \033[1;37mPEGA RUTA DE IMAGEN"
  442. echo -e "$bar"
  443. read -p "IMG: " img
  444. #[[ -z $img ]] && img="https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/favi.png"
  445. #[[ -z $img ]] && img="/var/www/html/bot_vmess_qr.png"
  446. [[ -z $MENSAJE ]] && MENSAJE="Hola, Mensale de Prueba del BotGen Generador!"
  447. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  448. URG="https://api.telegram.org/bot$TOKEN/sendPhoto"
  449. curl -s -X POST $URG -F chat_id=$ID -F photo="@$img" #-F caption="<code>New Script @ChumoGH</code>" #-F width="100" -F height="100"
  450. curl -s -X POST $URL -d chat_id=$ID -d text="$(echo -e "$MENSAJE")" &>/dev/null
  451. # clear
  452. echo -e "@$img"
  453. echo -e "$bar"
  454. echo -e "\033[1;37m Mensaje enviado Exitosamente...!"
  455. echo -e "$bar"
  456. read -p "ENTER PARA Continuar"
  457. }
  458. }
  459. bot_gen
  460. }
  461. act-bot () {
  462. echo "Respaldando TOKEN y ADMINISTRADOR"
  463. [[ -e /etc/ADM-db/token ]] && mv /etc/ADM-db/token /root/token
  464. [[ -e /etc/ADM-db/Admin-ID ]] && mv /etc/ADM-db/Admin-ID /root/Admin-ID
  465. [[ -e /etc/ADM-db/User-ID ]] && mv /etc/ADM-db/User-ID /root/User-ID
  466. [[ -e /etc/ADM-db/ress ]] && mv /etc/ADM-db/ress /root/ress
  467. [[ -e /etc/ADM-db/sources/costes ]] && mv /etc/ADM-db/sources/costes /root/costes
  468. [[ $(cat < /etc/ADM-db/resell) != "@ChumoGH" ]] && mv /etc/ADM-db/resell /root/resell
  469. rm -rf /etc/ADM-db/sources/gerar_key && download
  470. }
  471. respon () {
  472. [[ ! -e /etc/menu_ito ]] && credd=$(cat < /etc/SCRIPT/menu_credito) || credd=$(cat /etc/menu_ito )
  473. [[ -e ${CIDdir}/ress ]] && {
  474. echo -e "DESACTIVANDO RESELLER $credd FIJO EN BotGEN"
  475. echo -e " AHORA SE FIJARA EL NOMBRE DE QUIEN GENERE LA KEY"
  476. read -p "ENTER PARA VOLVER"
  477. rm -f ${CIDdir}/ress
  478. } || {
  479. echo -e "ACTIVANDO RESELLER $credd FIJO EN BotGEN"
  480. echo -e "AHORA SE FIJARA $credd EN TODAS LAS KEYS "
  481. read -p "ENTER PARA VOLVER"
  482. touch ${CIDdir}/ress
  483. }
  484. bot_gen
  485. }
  486. bot_gen () {
  487. clear
  488. unset PID_GEN
  489. CIDdir=/etc/ADM-db && [[ ! -d ${CIDdir} ]] && mkdir ${CIDdir}
  490. PID_GEN=$(ps x|grep -v grep|grep "BotGen.sh")
  491. PID_on=$(ps x|grep -v grep|grep "modelid")
  492. [[ ! $PID_on ]] && PID_on="\033[1;31mOFF" || PID_on="\033[1;32mON"
  493. [[ ! -e /etc/systemd/system/btkill.service ]] && PID_kill="\033[1;31mOFF" || PID_kill="\033[1;32mON"
  494. [[ ! $PID_GEN ]] && PID_GEN="\033[1;31mOFF" || PID_GEN="\033[1;32mON"
  495. [[ -e ${CIDdir}/token ]] && tk="\033[1;32mOK" || tk="\033[1;31mNULL"
  496. [[ -e /etc/numctc ]] && nm="\033[1;32mNUM" || nm="\033[1;31mNULL"
  497. [[ -e /etc/urlDN ]] && dn="\033[1;32mDON" || dn="\033[1;31mNULL"
  498. [[ -e /etc/urlCT ]] && ct="\033[1;32mCAT" || ct="\033[1;31mNULL"
  499. [[ -e ${CIDdir}/Admin-ID ]] && adid="\033[1;32mOK" || adid="\033[1;31mNULL"
  500. [[ -e ${CIDdir}/ress ]] && rfij="\033[1;32mRESELLER FIJO (Bot Personal )" || rfij="\033[1;31mRESELLER ALEATORIO ( Bot Custom )"
  501. limcont=$(cat /etc/ADM-db/limit)
  502. [[ "${limcont}" = "999" ]] && limted=" ∞ " || limted=$(cat /etc/ADM-db/limit)
  503. msg -bar
  504. echo -e " \033[7;49;35m ${TTini} 🐲 BotGEN ChumoGH${TTcent}ADM $(cat ${CIDdir}/vercion) 🐲 ◄◄<=== \033[0m"
  505. msg -bar
  506. echo -e " - LIMITADOR \033[1;32m ( $limted ) \033[1;37m KILL ID VENCIDOS ${PID_kill} "
  507. msg -bar
  508. echo -e "\033[0;35m[\033[0;36m1\033[0;35m] \033[0;35m> \033[1;37m TOKEN DEL BOT $tk "
  509. echo -e "\033[0;35m[\033[0;36m2\033[0;35m] \033[0;35m> \033[1;37m INICIAR/PARAR BOT $PID_GEN\033[0m"
  510. echo -e "\033[0;35m[\033[0;36m3\033[0;35m] \033[0;35m> \033[1;37m ID DE USUARIO TELEGRAM $adid"
  511. echo -e "\033[0;35m[\033[0;36m4\033[0;35m] \033[0;35m> \033[1;37m Cambiar Contacto -> $(cat < ${CIDdir}/resell)"
  512. echo -e "\033[0;35m[\033[0;36m5\033[0;35m] \033[0;35m> \033[1;37m MENSAJE DE PRUEBA"
  513. echo -e "\033[0;35m[\033[0;36m6\033[0;35m] \033[0;36m> \033[1;37m MANUAL De Uso"
  514. echo -e "\033[0;35m[\033[0;36m7\033[0;35m] \033[0;35m> \033[1;37m Limite de KEYS "
  515. echo -e "\033[0;35m[\033[0;36m8\033[0;35m] \033[0;35m> \033[1;37m ENLACES $nm | $dn | $ct "
  516. echo -e "\033[0;35m[\033[0;36m9\033[0;35m] \033[0;35m> \033[1;37m $rfij"
  517. echo -e "\033[0;35m[\033[0;36m10\033[0;35m] \033[0;35m> \033[1;37m MSG POR ID"
  518. echo -e "\033[0;35m[\033[0;36m11\033[0;35m] \033[0;35m> \033[1;37m Modificar COSTES DEL BOT"
  519. msg -bar
  520. echo -e "\033[0;35m[\033[0;36m0\033[0;35m] \033[0;34m<\033[0;33m SALIR"
  521. msg -bar
  522. selection=$(selection_fun 11)
  523. case ${selection} in
  524. 0) gerar && exit ;;
  525. 1) ini_token;;
  526. 2) start_bot;;
  527. 3) ini_id;;
  528. 4) ini_res;;
  529. 5) msj_prueba;;
  530. 6) ayuda_fun;;
  531. #7) source <(curl -sSL https://www.dropbox.com/s/f5mlwun3hkpq6k8/bot-permited.sh) ;;
  532. #8) act-bot ;;
  533. 7) lim-bot ;;
  534. 8) change_pay;;
  535. 9) respon;;
  536. 10)msj_ind;;
  537. 11)edit_cost;;
  538. *) bot_gen;;
  539. esac
  540. }