add player role badge
This commit is contained in:
@ -29,7 +29,7 @@ export default interface ScoreSaberPlayer extends Player {
|
||||
/**
|
||||
* The role the player has.
|
||||
*/
|
||||
role: ScoreSaberRole | undefined;
|
||||
role: string | undefined;
|
||||
|
||||
/**
|
||||
* The badges the player has.
|
||||
@ -87,7 +87,6 @@ export async function getScoreSaberPlayerFromToken(
|
||||
lines: token.bio?.split("\n") || [],
|
||||
linesStripped: token.bio?.replace(/<[^>]+>/g, "")?.split("\n") || [],
|
||||
};
|
||||
const role = token.role == null ? undefined : (token.role as ScoreSaberRole);
|
||||
const badges: ScoreSaberBadge[] =
|
||||
token.badges?.map(badge => {
|
||||
return {
|
||||
@ -269,7 +268,7 @@ export async function getScoreSaberPlayerFromToken(
|
||||
monthly: getStatisticChanges(30),
|
||||
yearly: getStatisticChanges(365),
|
||||
},
|
||||
role: role,
|
||||
role: token.role == null ? undefined : token.role,
|
||||
badges: badges,
|
||||
statisticHistory: statisticHistory,
|
||||
statistics: token.scoreStats,
|
||||
@ -299,11 +298,6 @@ export type ScoreSaberBio = {
|
||||
linesStripped: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* The ScoreSaber account roles.
|
||||
*/
|
||||
export type ScoreSaberRole = "Admin";
|
||||
|
||||
/**
|
||||
* A badge for a player.
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@ import ScoreSaberPlayerToken from "../types/token/scoresaber/score-saber-player-
|
||||
import ScoreSaberLeaderboardPlayerInfoToken from "../types/token/scoresaber/score-saber-leaderboard-player-info-token";
|
||||
import ScoreSaberPlayer from "../player/impl/scoresaber-player";
|
||||
|
||||
type ScoreSaberRole = {
|
||||
export type ScoreSaberRole = {
|
||||
/**
|
||||
* The name of the role.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user