MCPcopy
hub / github.com/SYJun404/frank / querySummonerInfo

Function querySummonerInfo

src/lcu/aboutSummoner.ts:9–30  ·  view source on GitHub ↗
(summonerId?:number|string)

Source from the content-addressed store, hash-verified

7
8// 查询本地召唤师信息
9export const querySummonerInfo = async (summonerId?:number|string):Promise<summonerInfo | null> => {
10 const endpoint = summonerId
11 ? `/lol-summoner/v1/summoners/${summonerId}`
12 : '/lol-summoner/v1/current-summoner';
13
14 const summonerInfo: lcuSummonerInfo | null = await invokeLcu('get', endpoint)
15
16 if (summonerInfo === null){
17 return null
18 }
19
20 return {
21 privacy:summonerInfo.privacy,
22 puuid:summonerInfo.puuid,
23 tagLine:summonerInfo.tagLine,
24 name:summonerInfo.gameName||summonerInfo.displayName,
25 currentId: summonerInfo.summonerId,
26 lv:"Lv "+summonerInfo.summonerLevel,
27 xp:parseInt(String((summonerInfo.xpSinceLastLevel / summonerInfo.xpUntilNextLevel ) * 100)),
28 imgUrl:`https://wegame.gtimg.com/g.26-r.c2d3c/helper/lol/assis/images/resources/usericon/${summonerInfo.profileIconId}.png`
29 }
30}
31
32// 查询所在服务器ID
33export const queryPlatformId = async (puuid:string):Promise<string> => {

Callers 3

BaseMatchClass · 0.90

Calls 1

invokeLcuFunction · 0.90

Tested by

no test coverage detected