diff --git a/bot/bot.lua b/bot/bot.lua index f326945..7cfc8d7 100644 --- a/bot/bot.lua +++ b/bot/bot.lua @@ -9,7 +9,7 @@ function on_msg_receive (msg) if msg_valid(msg) then msg = pre_process_msg(msg) match_plugins(msg) --- mark_read(receiver, ok_cb, false) + --mark_read(receiver, ok_cb, false) end end diff --git a/plugins/boersedown.lua b/plugins/boersedown.lua new file mode 100644 index 0000000..f87ed6d --- /dev/null +++ b/plugins/boersedown.lua @@ -0,0 +1,24 @@ +socket = require("socket") + +function cron() + -- Use yours desired web and id + local addr = "www.boerse.to" + local dest = "chat#id11215880" + -- Checks a TCP connexion + local connexion = socket.connect(addr, 80) + if not connexion then + local text = "boerse.to ist schon wieder Offline..." + print (text) + send_msg(dest, text, ok_cb, false) + else + connexion:close() + end +end + +return { + description = "", + usage = "", + patterns = {}, + run = nil, + cron = cron +} \ No newline at end of file diff --git a/plugins/search_youtube.lua b/plugins/search_youtube.lua index 94df62f..7a3b4b5 100644 --- a/plugins/search_youtube.lua +++ b/plugins/search_youtube.lua @@ -46,7 +46,8 @@ return { description = "Sucht ein Video auf YouTube und sendet es", usage = "/youtube [Begriff]", patterns = { - "^/youtube (.*)" + "^/youtube (.*)", + "^/yt (.*)" }, run = run } diff --git a/plugins/sh.lua b/plugins/sh.lua index 42c283b..e16b5c7 100644 --- a/plugins/sh.lua +++ b/plugins/sh.lua @@ -1,3 +1,4 @@ + function run_sh(msg) name = get_name(msg) text = '' @@ -35,4 +36,4 @@ return { patterns = {"^/uptime", "^/sh (.*)$"}, run = run, privileged = true -} \ No newline at end of file +}