//parse weight param and uid; doesnt work if -w is immediately followed by pp params like 100x etc
Stringuid=null;
booleanweight=wParamIndex!=-1;
if(weight){
try{
intwParamLength=1;
uid=amend.get(wParamIndex+1);
if(!uid.contains("osu.ppy.sh/u")&&(uid.startsWith("http")&&uid.contains("://"))){//url thats not user url means its most likely a beatmap, aka no username param
channel.sendMessage("Trying to retrieve map from discord status...").queue(m->msgId.complete(m.getId()));//DONE custom status masks presence now, will not be as effective; any way to get manually? //JDA 4 API change fixed this
channel.sendTyping().queue();
//parse map name and search
if(details!=null){//TODO if name is sth like `Feryquitous - (S).0ngs//---::compilation.[TQR-f3] [-[//mission:#FC.0011-excindell.defer.abferibus]-]` it breaks (but reasonable break tbh); also breaks if difficulty has " in it
channel.sendMessage("For "+uid+" to actually gain "+df.format(targetPP)+"pp in "+modes[modeId]+", they have to play a map worth approximately **"+df.format(mid)+"pp** raw.").queue();
if(modeId>1)modeId=0;//ignore unsupported modes and default to standard
booleanpassOnly=params.removeAll(Collections.singleton("-p"));//no need space, as spaced ones are split (if a player has a name with spaced -p it might be a problem)
returnnewCommandResult(CommandResultType.INVALIDARGS,"Unknown player `"+res.getString("search")+"` or the player has not been playing in the last 24h.");
array=res.getJSONArray("result");
if(array.length()==0)
returnnewCommandResult(CommandResultType.FAILURE,"You have no recent plays in this 24h!");
//set name according to supported formats
name=res.getBoolean("isId")?//isId might return true on cases inputted as https://osu.ppy.sh/users/despawningbone for example, which would make the fetching redundant but still works
XYChartchart=newXYChartBuilder().width(800).height(600).title("Top PP plays for "+concName+" ("+modes[modeId]+")").yAxisTitle("PP").xAxisTitle("Plays (100 = top)").build();
em.addField("Difficulty","["+json.getString("version")+"](https://osu.ppy.sh/b/"+json.getString("beatmap_id")+")"+" ([Preview](https://jmir.xyz/osu/#"+json.getString("beatmap_id")+"))",false);//bloodcat is no longer a thing but someone hosted a copy for previewing here
mode=card.getContentDisplay().contains("Mania")?"mania":card.getContentDisplay().split("Recent ")[1].split(" ")[0];//ye fucking blame owobot for being so inconsistent
returnnewCommandResult(CommandResultType.INVALIDARGS,"Unknown player `"+uid+"` or the player has no scores on this map.");
}
},"[username] [| index]",null,"Compare your score with the most recent map/score card in the channel!",Arrays.asList(" * Specify the index to skip to the nth recent score card in the channel."));