Skip to content

Commit f1cae54

Browse files
author
topkecleon
committed
improve everything :^)
1 parent 7a21eac commit f1cae54

File tree

2 files changed

+20
-29
lines changed

2 files changed

+20
-29
lines changed

README.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
# binsh
2-
<strong>Shell bin output for telegram-bot</strong>
1+
#binsh
2+
**Shell output for [telegram-bot](http://github.com/yagop/telegram-bot).**
33

4-
<strong>Warning:</strong> As this plugin has direct access to the
5-
system, even though
6-
there is no way to achieve root access, it may cause
7-
harm, so be extra careful.
4+
**Warning:** This plugin interfaces with your operating system. Even without root privileges, a bad command can be harmful.
85

9-
# Usage
10-
Enable the plugin with `!plugin enable bin`
6+
##Usage
7+
Enable the plugin with `!plugin enable bin`.
118

12-
Feed telegram `!bin uptime` command as an example
13-
14-
Any binary file in the `/bin/` directory can be executed
9+
Send `!bin uptime` for an example.

bin.lua

+14-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
do
2-
3-
function run(msg, matches)
4-
local file = assert(io.popen("/bin/" .. matches[1], 'r'))
5-
local output = file:read('*all')
6-
file:close()
7-
print(output)
8-
return output
9-
end
10-
11-
return {
12-
description = "Run",
13-
usage = {"!bin n shit"},
14-
patterns = {
15-
"^!bin (.*)$"
16-
},
17-
run = run
18-
}
19-
2+
3+
function run(msg, matches)
4+
return io.popen(matches[1]):read('*all')
5+
end
6+
7+
return {
8+
description = 'Run a system command.',
9+
usage = {'!bin <command>'},
10+
patterns = {
11+
'^!bin (.*)$'
12+
},
13+
run = run
14+
}
15+
2016
end

0 commit comments

Comments
 (0)