Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function vardump(value)
end

function reload()
tabchi = dofile("tabchi.lua")
loadfile("tabchi.lua")()
end

function dl_cb (arg, data)
Expand All @@ -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")
Expand Down
12 changes: 12 additions & 0 deletions importer.lua
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file modified tabchi.lua
Binary file not shown.