diff --git a/README.md b/README.md index 5bd0bde..f5b41da 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,24 @@ -# Tabchi V4 +# Tabchi V3.1 TG-CLI based broadcasting bot! ## Install ```bash +git clone https://github.com/Iteam-co/Tabchi --branch lastfix +cd Tabchi chmod 777 install.sh ./install.sh ``` ## Create a bot! ``` root@iTeam:~# lua creator.lua -Auto Detected Tabchi ID : 0 +Auto Detected Tabchi ID : 1 Enter Full Sudo ID : 122774063 Done! New Tabchi Created... -ID : 0 +ID : 1 Full Sudo : 122774063 -Run : ./tabchi-0.sh +Run : ./tabchi-1.sh ``` Enter your telegram Id in "Full Sudo ID" part diff --git a/base.lua b/base.lua index d344eae..808ae37 100644 --- a/base.lua +++ b/base.lua @@ -8,7 +8,7 @@ function vardump(value) end function reload() - tabchi = dofile("tabchi.lua") + loadfile("tabchi.lua")() end function dl_cb (arg, data) @@ -17,7 +17,7 @@ end reload() function tdcli_update_callback(data) - tabchi.update(data, tabchi_id) + update(data, tabchi_id) if data.message_ and data.message_.content_.text_ and data.message_.content_.text_ == "/reload" and data.message_.sender_user_id_ == tonumber(redis:get("tabchi:" .. tabchi_id ..":fullsudo")) then reload() tdcli.sendMessage(data.message_.chat_id_, 0, 1, "*Bot Reloaded*", 1, "md") diff --git a/importer.lua b/importer.lua new file mode 100644 index 0000000..d5e9ac7 --- /dev/null +++ b/importer.lua @@ -0,0 +1,12 @@ +print("Import your old tabchi without reentering the new SUDO id!") +redis = (loadfile "redis.lua")() +io.write("Enter Tabchi ID : ") +local last = io.read() +local sudo=redis:get("tabchi:"..last..":fullsudo") +io.write("\nEnter Full Sudo ID : "..sudo) +local text,ok = io.open("base.lua",'r'):read('*a'):gsub("TABCHI%-ID",last) +io.open("tabchi-"..last..".lua",'w'):write(text):close() +io.open("tabchi-"..last..".sh",'w'):write("while true; do\n./telegram-cli-1222 -p tabchi-"..last.." -s tabchi-"..last..".lua\ndone"):close() +io.popen("chmod 777 tabchi-"..last..".sh") +redis:set('tabchi:'..last..':fullsudo',sudo) +print("Done!\nNew Tabchi Created...\nID : "..last.."\nFull Sudo : "..sudo.."\nRun : ./tabchi-"..last..".sh") diff --git a/install.sh b/install.sh index f7c95b5..777c31a 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash wget "https://valtman.name/files/telegram-cli-1222" -sudo apt-get -y install libreadline6 libreadline-dev libreadline-dev libreadline6-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev lua-socket lua-sec lua-expat libevent-dev make unzip redis-server autoconf git g++ libjansson-dev libpython-dev expat libexpat1-dev ppa-purge python3-pip python3-dev software-properties-common python-software-properties gcc-6 +sudo apt-get install libreadline6 libreadline-dev libreadline-dev libreadline6-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev lua-socket lua-sec lua-expat libevent-dev make unzip redis-server autoconf git g++ libjansson-dev libpython-dev expat libexpat1-dev ppa-purge python3-pip python3-dev software-properties-common python-software-properties sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get upgrade diff --git a/tabchi.lua b/tabchi.lua index 27878e4..89db2ff 100644 Binary files a/tabchi.lua and b/tabchi.lua differ