Kleine Fixes

This commit is contained in:
Akamaru 2016-07-12 21:58:32 +02:00
parent 7f8f99c8d5
commit f6c02d5efa
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ end
return {
description = "Zeigt PlayStation Store Infos",
usage = "Link zum PlayStation Store",
patterns = {"^https?://store.playstation.com/#!/de%-de/spiel/.*/cid=(.*)$"},
patterns = {"store.playstation.com/#!/de%-de/spiel/.*/cid=(.*)"},
run = run
}

View File

@ -5,7 +5,7 @@ local function getUrbanDictionary(term)
local res,code = http.request(url)
local data = json:decode(res)
if code ~= 200 then return "HTTP-Fehler" end
if not data then return "Nichts gefunden!" end
if data.result_type == 'no_results' then return "Nichts gefunden!" end
local word = data.list[1].word
local dev = data.list[1].definition
@ -15,7 +15,7 @@ local function getUrbanDictionary(term)
sound = data.sounds[1]
end
local text = unescape(word..'\n'..dev..'\n\nBeispiel: "'..exam..'"\n')..url
local text = unescape(word..'\n'..dev..string.gsub('\n\nBeispiel: "'..exam..'"\n', '""', '"'))..url
if data.sounds[1] then
return text, sound