This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/screen.lua

32 lines
765 B
Lua
Raw Normal View History

2015-05-22 14:28:23 +02:00
function run_sh(msg)
name = get_name(msg)
text = ''
bash = msg.text:sub(4,-1)
text = run_bash(bash)
return text
end
function run_bash(str)
local cmd = io.popen(str)
local result = cmd:read('*all')
cmd:close()
return result
end
function run(msg, matches)
local receiver = get_receiver(msg)
if string.starts(msg.text, '/screen') then
text = run_bash("scrot 'scrot.png' -e 'mv $f ~/Mikubot/tmp/'")
send_photo(get_receiver(msg), "tmp/scrot.png", ok_cb, false)
2015-05-22 14:50:58 +02:00
return 'Screenshot wird gesendet!'
2015-05-22 14:28:23 +02:00
end
end
return {
description = "Macht ein Screenshot vom PC auf dem der Bot l<>uft",
usage = {"/screen"},
patterns = {"^/screen$"},
2015-06-07 22:49:42 +02:00
run = run,
privileged = true
2015-05-22 14:28:23 +02:00
}
2015-05-22 17:01:33 +02:00
--by Akamaru [https://ponywave.de]