new plugins yagyuu and riko

by @Brawl345
This commit is contained in:
Akamaru 2015-06-11 17:11:00 +02:00
parent 782020e61f
commit 2610903759
4 changed files with 52 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

25
plugins/riko.lua Normal file
View File

@ -0,0 +1,25 @@
do
local function get_url()
local url = 'http://riko.moe'
local res,code = http.request(url)
if code ~=200 then return "Fehler beim Abrufen von yagyuu.moe" end
local photo_url = string.match(res, "<img src%=\"(.-)\" alt")
local photo_url = url..'/'..photo_url
return photo_url
end
local function run(msg, matches)
local photo_url = get_url()
local receiver = get_receiver(msg)
send_photo_from_url(receiver, photo_url)
end
return {
description = "Postet ein Bild von riko.moe",
usage = "/riko",
patterns = {"^/[R|r]iko$"},
run = run
}
-- Created by github.com/Brawl345
end

View File

@ -16,10 +16,6 @@ function run(msg, matches)
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/katsuragi.jpg", ok_cb, false)
end
if string.starts(msg.text, '/yagyuu') or string.starts(msg.text, "/Yagyuu") then
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/yagyuu.jpg", ok_cb, false)
end
if string.starts(msg.text, '/haruka') or string.starts(msg.text, "/Haruka") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/haruka.jpg", ok_cb, false)
end
@ -43,8 +39,8 @@ end
return {
description = "Sendet euch ein Senran Kagura Charakter",
usage = {"/asuka","/Asuka","/hibari","/Hibari","/ikaruga","/Ikaruga","/katsuragi","/Katsuragi","/yagyuu","/Yagyuu","/haruka","/Haruka","/hikage","/Hikage","/homura","/Homura","/mirai","/Mirai","/yomi","/Yomi"},
patterns = {"^/asuka","^/Asuka","^/hibari","^/Hibari","^/ikaruga","^/Ikaruga","^/katsuragi","^/Katsuragi","^/yagyuu","^/Yagyuu","^/haruka","^/Haruka","^/hikage","^/Hikage","^/homura","^/Homura","^/mirai","^/Mirai","^/yomi","^/Yomi"},
usage = {"/asuka","/Asuka","/hibari","/Hibari","/ikaruga","/Ikaruga","/katsuragi","/Katsuragi","/haruka","/Haruka","/hikage","/Hikage","/homura","/Homura","/mirai","/Mirai","/yomi","/Yomi"},
patterns = {"^/asuka","^/Asuka","^/hibari","^/Hibari","^/ikaruga","^/Ikaruga","^/katsuragi","^/Katsuragi","^/haruka","^/Haruka","^/hikage","^/Hikage","^/homura","^/Homura","^/mirai","^/Mirai","^/yomi","^/Yomi"},
run = run
}
--by Akamaru [https://ponywave.de]

25
plugins/yagyuu.lua Normal file
View File

@ -0,0 +1,25 @@
do
local function get_url()
local url = 'http://yagyuu.moe'
local res,code = http.request(url)
if code ~=200 then return "Fehler beim Abrufen von yagyuu.moe" end
local photo_url = string.match(res, "<img src%=\"(.-)\" alt")
local photo_url = url..'/'..photo_url
return photo_url
end
local function run(msg, matches)
local photo_url = get_url()
local receiver = get_receiver(msg)
send_photo_from_url(receiver, photo_url)
end
return {
description = "Postet ein Bild von yagyuu.moe",
usage = "/yagyuu",
patterns = {"^/[Y|y]agyuu$"},
run = run
}
-- Created by github.com/Brawl345
end