kitty.lua use thecatapi.com
This commit is contained in:
parent
99391a8667
commit
23e0b9faeb
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
Before Width: | Height: | Size: 53 KiB |
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
Binary file not shown.
Before Width: | Height: | Size: 56 KiB |
@ -1,18 +1,11 @@
|
|||||||
function run(msg, matches)
|
local function run(msg, matches)
|
||||||
randomValue = math.random(4)
|
local receiver = get_receiver(msg)
|
||||||
if randomValue == 1 then
|
local url = 'http://thecatapi.com/api/images/get'
|
||||||
send_photo(get_receiver(msg), "pictures/cats/cat1.jpg", ok_cb, false)
|
send_photo_from_url(receiver, url)
|
||||||
elseif randomValue == 2 then
|
|
||||||
send_photo(get_receiver(msg), "pictures/cats/cat2.jpg", ok_cb, false)
|
|
||||||
elseif randomValue == 3 then
|
|
||||||
send_photo(get_receiver(msg), "pictures/cats/cat3.jpg", ok_cb, false)
|
|
||||||
elseif randomValue == 4 then
|
|
||||||
send_photo(get_receiver(msg), "pictures/cats/cat4.jpg", ok_cb, false)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
description = "Sendet eins von 4 Katzenbilder",
|
description = "Sendet ein zufälliges Katzenbild",
|
||||||
usage = {"/kitty","/katze","/cat","/neko","/kadse"},
|
usage = {"/kitty","/katze","/cat","/neko","/kadse"},
|
||||||
patterns = {"^/kitty$","^/katze$","^/cat$","^/neko$","^/kadse$"},
|
patterns = {"^/kitty$","^/katze$","^/cat$","^/neko$","^/kadse$"},
|
||||||
run = run
|
run = run
|
||||||
|
Reference in New Issue
Block a user