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/curl_head.lua

24 lines
659 B
Lua
Raw Normal View History

2015-08-19 15:15:24 +02:00
function run(msg, matches)
local receiver = get_receiver(msg)
local URL = matches[1]
if string.match(msg.text, '"') then
return 'Vergiss es'
end
2015-11-12 17:42:03 +01:00
if string.match(msg.text, '[Hh][Ee][Aa][Dd]') then
2015-08-19 15:15:24 +02:00
text = run_bash('curl --head --insecure ' .. URL)
send_msg(receiver, text, ok_cb, false)
2015-11-12 17:42:03 +01:00
elseif string.match(msg.text, '[Dd][Ii][Gg]') then
text = run_bash('dig ' .. URL .. ' ANY')
send_msg(receiver, text, ok_cb, false)
2015-08-19 15:15:24 +02:00
end
end
return {
description = "F<EFBFBD>hrt Befehle in der Konsole aus",
usage = {""},
patterns = {"^#[Hh][Ee][Aa][Dd] (.*)$","^#[Dd][Ii][Gg] (.*)"},
2015-08-19 15:15:24 +02:00
run = run
2015-11-12 17:42:03 +01:00
}
--by Akamaru [https://ponywave.de]