this.desc="Search across all the fan-made wikis!";
this.alias=Arrays.asList("wikia","gamepedia");//gamepedia is now fandom basically
this.usage="<wiki name>: <search> [| index]";
this.examples=Arrays.asList("zelda: gate of time","clockwork planet: ryuZU","angel beats: kanade");
}
@Override//query for details using future too? since i already have to make 2 queries, making 3 in parallel wont make it much slower; the only concern is rate limit //already doing sequential 3 queries, aint too slow so its fine
//the wikia domain is still in use; no need to swap to fandom.com for now
//alternative search endpoint (more of an autocomplete only but much faster): "https://" + wiki + ".wikia.com/wikia.php?controller=LinkSuggest&method=getLinkSuggestions&format=json&query=" + search
//only use until the last full stop before table of content or end for slightly better formatting
//there might be false positives for table of content detection since its just checking 1 after full stop, but honestly rarely less details > commonly being ugly af
Stringdesc=info.getString("abstract").replaceAll("^(?:(.*?\\.) ?1 .*|(.*\\.) .*?)$","$1$2");//greedy if table of content is present, else lazy to get the last
eb.setDescription(desc.matches(".*\\.$")?desc:(desc+"..."));//if everything fails (aka last char aint a full stop) give it the good ol ... treatment
if(!info.isNull("thumbnail"))eb.setThumbnail(info.getString("thumbnail").substring(0,info.getString("thumbnail").indexOf("/revision/")));//get full img by trimming revision path
eb.setFooter("Last edited by "+info.getJSONObject("revision").getString("user"),null);