Модуль:IanComradeBot/prototypes/fills/Item.json/data: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 2: | Строка 2: | ||
local jsonData = title and title:getContent() or "" | local jsonData = title and title:getContent() or "" | ||
local success, data = pcall(mw.text.jsonDecode, jsonData) | local success, data = pcall(mw.text.jsonDecode, jsonData) | ||
if success and type(data) == "table" then | |||
if data.id then | |||
return { data } | |||
else | |||
return data | |||
end | |||
else | |||
return {} | |||
end | |||