MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / getIcon

Function getIcon

Rewrite-Parser.js:2015–2031  ·  view source on GitHub ↗
(icon)

Source from the content-addressed store, hash-verified

2013
2014//获取可莉图标集
2015async function getIcon(icon) {
2016 let url = 'https://raw.githubusercontent.com/luestr/IconResource/main/KeLee_icon.json'
2017 let kicon = $.getjson('Parser_Kelee_icon')
2018 if (!kicon) {
2019 kicon = $.toObj((await http(url)).body)['icons']
2020 $.setjson(kicon, 'Parser_Kelee_icon')
2021 }
2022 for (let i = 0; i < kicon.length; i++) {
2023 if (kicon[i].name == icon) return kicon[i].url
2024 }
2025 kicon = $.toObj((await http(url)).body)['icons']
2026 $.setjson(kicon, 'Parser_Kelee_icon')
2027 for (let i = 0; i < kicon.length; i++) {
2028 if (kicon[i].name == icon) return kicon[i].url
2029 }
2030 return 'icon not found'
2031}
2032
2033//reject
2034function rw_reject(x, mark) {

Callers 1

Rewrite-Parser.jsFile · 0.70

Calls 4

httpFunction · 0.70
getjsonMethod · 0.45
toObjMethod · 0.45
setjsonMethod · 0.45

Tested by

no test coverage detected