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

Function getIcon

Rewrite-Parser.beta.js:2418–2434  ·  view source on GitHub ↗
(icon)

Source from the content-addressed store, hash-verified

2416
2417//获取可莉图标集
2418async function getIcon(icon) {
2419 let url = 'https://raw.githubusercontent.com/luestr/IconResource/main/KeLee_icon.json'
2420 let kicon = $.getjson('Parser_Kelee_icon')
2421 if (!kicon) {
2422 kicon = $.toObj((await http(url)).body)['icons']
2423 $.setjson(kicon, 'Parser_Kelee_icon')
2424 }
2425 for (let i = 0; i < kicon.length; i++) {
2426 if (kicon[i].name == icon) return kicon[i].url
2427 }
2428 kicon = $.toObj((await http(url)).body)['icons']
2429 $.setjson(kicon, 'Parser_Kelee_icon')
2430 for (let i = 0; i < kicon.length; i++) {
2431 if (kicon[i].name == icon) return kicon[i].url
2432 }
2433 return 'icon not found'
2434}
2435
2436//reject
2437function rw_reject(x, mark) {

Callers 1

Calls 4

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

Tested by

no test coverage detected