31 lines
673 B
Lua
31 lines
673 B
Lua
do
|
|
|
|
local function run(msg, matches)
|
|
local receiver = get_receiver(msg)
|
|
local url = "http://code.ponywave.de/workspace/mikubot/sounds/"..matches[1]..".mp3"
|
|
local file = download_to_file(url)
|
|
local cb_extra = {file_path=file}
|
|
|
|
if string.match(msg.text, "[Ll][Ii][Ss][Tt][Ee]") then
|
|
return 'Eine Liste aller Sounds findet ihr hier: https://ponywave.de/a/sounds'
|
|
end
|
|
|
|
if not file then
|
|
return "Nichts gefunden!"
|
|
else
|
|
print('Sende Datei')
|
|
send_document(receiver, file, rmtmp_cb, cb_extra)
|
|
end
|
|
|
|
end
|
|
|
|
return {
|
|
description = "Sound Bar",
|
|
usage = {"/sound [Name]"},
|
|
patterns = {
|
|
"^/sound (.*)$"
|
|
},
|
|
run = run
|
|
}
|
|
|
|
end |