File tree 2 files changed +20
-29
lines changed
2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change 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 ) . **
3
3
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.
8
5
9
- # Usage
10
- Enable the plugin with ` !plugin enable bin `
6
+ ## Usage
7
+ Enable the plugin with ` !plugin enable bin ` .
11
8
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.
Original file line number Diff line number Diff line change 1
1
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
+
20
16
end
You can’t perform that action at this time.
0 commit comments