This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/gronkh_soundboard.lua

40 lines
1.1 KiB
Lua
Raw Normal View History

--Sounds from http://xufox.bplaced.net/GronkhSoundboard/
2015-11-12 17:42:03 +01:00
do
local function run(msg, matches)
local receiver = get_receiver(msg)
local url = "http://code.ponywave.de/workspace/mikubot/gronkhsounds/"..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 "Hier eine Liste aller Sounds: PonyWave.de/a/gronkhsounds"
elseif string.match(msg.text, "[Rr][Aa][Nn][Dd][Oo][Mm]") then
return "Kommt noch!"
2015-11-12 17:42:03 +01:00
end
if not file then
return "Nichts gefunden!\nSicher, dass "..matches[1].." existiert?"
2015-11-12 17:42:03 +01:00
else
print('Sende Sound')
2015-11-13 20:51:12 +01:00
send_audio(receiver, file, rmtmp_cb, cb_extra)
2015-11-12 17:42:03 +01:00
end
end
return {
description = "Gronkh Soundboard",
usage = {"/gronkh [Sound]: Sendet ein Sound",
"/gronkh liste: Zeigt alle verfügbare Sounds",
"/gronkh random: Sendet ein zufälligen Sound (Kommt noch)"},
2015-11-12 17:42:03 +01:00
patterns = {
"^/[Gg][Rr][Oo][Nn][Kk][Hh] (.*)$"
2015-11-12 17:42:03 +01:00
},
run = run
}
end
--by Akamaru [https://ponywave.de]