Last active
March 30, 2022 05:43
-
-
Save alxtz/ecff328208d83b3aab8907ec04d7bb27 to your computer and use it in GitHub Desktop.
其實不是什麼高深的東西,給大家複製來自己改,有語法問題可以問 twitch: alex_tzeng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!commands edit -cd=5 !亞服 | |
$(eval | |
let api = $(urlfetch json https://playhearthstone.com/en-us/api/community/leaderboardsData?region=AP&leaderboardId=BG&seasonId=3); | |
let r = api.leaderboard.rows; | |
let q = "$(1)"; | |
let rest = q.substring(1, q.length); | |
let f = q[0] === '#' ? r[parseInt(rest) - 1] : r.find(u => u.accountid.toUpperCase() === q.toUpperCase()); | |
f === undefined ? `[$(user)]: ${q} 不在亞服排行榜,沒料` : `[$(user)]: ${f.accountid} 目前亞服 #${f.rank},${f.rating}分`; | |
) | |
!commands edit -cd=5 !美服 | |
$(eval | |
let api = $(urlfetch json https://playhearthstone.com/en-us/api/community/leaderboardsData?region=US&leaderboardId=BG&seasonId=3); | |
let r = api.leaderboard.rows; | |
let q = "$(1)"; | |
let rest = q.substring(1, q.length); | |
let f = q[0] === '#' ? r[parseInt(rest) - 1] : r.find(u => u.accountid.toUpperCase() === q.toUpperCase()); | |
f === undefined ? `[$(user)]: ${q} 不在美服排行榜,沒料` : `[$(user)]: ${f.accountid} 目前美服 #${f.rank},${f.rating}分`; | |
) | |
!commands edit -cd=5 !歐服 | |
$(eval | |
let api = $(urlfetch json https://playhearthstone.com/en-us/api/community/leaderboardsData?region=EU&leaderboardId=BG&seasonId=3); | |
let r = api.leaderboard.rows; | |
let q = "$(1)"; | |
let rest = q.substring(1, q.length); | |
let f = q[0] === '#' ? r[parseInt(rest) - 1] : r.find(u => u.accountid.toUpperCase() === q.toUpperCase()); | |
f === undefined ? `[$(user)]: ${q} 不在歐服排行榜,沒料` : `[$(user)]: ${f.accountid} 目前歐服 #${f.rank},${f.rating}分`; | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changelog v1.0.0
[zh-TW]
[en-US]
TODO