use of chatty.util.UrlRequest.FullResult in project chatty by chatty.
the class WebsocketManager method fetchEmoteSet.
/**
* Get the emotes from a specific emoteset, useable in the given room.
*
* @param room The channel the emotes should be useable in
* @param emoteset The FFZ emoteset to fetch
* @return A set of emotes or an empty set if an error occured
*/
private Set<Emoticon> fetchEmoteSet(String room, int emoteset) {
UrlRequest r = new UrlRequest("https://api.frankerfacez.com/v1/set/" + emoteset);
FullResult result = r.sync();
if (result.getResult() != null) {
Set<Emoticon> emotes = FrankerFaceZParsing.parseSetEmotes(result.getResult(), Emoticon.SubType.EVENT, room);
return emotes;
}
return new HashSet<>();
}
Aggregations