random_pic plugins with error message
This commit is contained in:
parent
6c2d953c93
commit
510184e398
@ -8,8 +8,9 @@ end
|
||||
function run(msg, matches)
|
||||
local pics = {
|
||||
-- add more below!
|
||||
["anime"] = "/home/pi/USB/sfw/anime/",
|
||||
["mlp"] = "/home/pi/USB/sfw/mlp/"
|
||||
["test"] = "../USB/test/",
|
||||
["anime"] = "../USB/sfw/anime/",
|
||||
["mlp"] = "../USB/sfw/mlp/"
|
||||
}
|
||||
|
||||
local receiver = get_receiver(msg)
|
||||
@ -20,9 +21,13 @@ function run(msg, matches)
|
||||
print("Sende... "..img)
|
||||
if string.ends(img, ".gif") then
|
||||
send_document(receiver, img, function() end, function() end)
|
||||
else
|
||||
elseif string.ends(img, ".jpg") or string.ends(img, ".jpeg") or string.ends(img, ".png") then
|
||||
send_photo(receiver, img, function() end, function() end)
|
||||
else
|
||||
return "Fehler: " .. img
|
||||
end
|
||||
else
|
||||
return '"'..imgtype..'" gibt es nicht.\nEs gibt:\nanime\nmlp'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -19,9 +19,13 @@ function run(msg, matches)
|
||||
print("Sende... "..img)
|
||||
if string.ends(img, ".gif") then
|
||||
send_document(receiver, img, function() end, function() end)
|
||||
else
|
||||
elseif string.ends(img, ".jpg") or string.ends(img, ".jpeg") or string.ends(img, ".png") then
|
||||
send_photo(receiver, img, function() end, function() end)
|
||||
else
|
||||
return "Fehler: " .. img
|
||||
end
|
||||
else
|
||||
return '"'..imgtype..'" gibt es nicht.\n'
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user