Search in sources :

Example 71 with JSONObject

use of org.jsolf.JSONObject in project Emolga by TecToast.

the class Draft method getTeamMembers.

public static List<Long> getTeamMembers(String team) {
    JSONObject asl = getEmolgaJSON().getJSONObject("drafts").getJSONObject("ASLS9");
    int index = asl.getStringList("teams").indexOf(team);
    LinkedList<Long> l = new LinkedList<>();
    if (index == -1)
        return l;
    for (int i = 1; i <= 4; i++) {
        l.add(asl.getJSONObject("S" + i).getLongList("table").get(index));
    }
    return l;
}
Also used : JSONObject(org.jsolf.JSONObject)

Example 72 with JSONObject

use of org.jsolf.JSONObject in project Emolga by TecToast.

the class BanManager method unban.

public JSONObject unban(Guild g, long userid) {
    JSONObject o = new JSONObject();
    logger.info("userid = " + userid);
    logger.info("g.getIdLong() = " + g.getIdLong());
    g.unban(String.valueOf(userid)).queue();
    return delete(and(GUILDID.check(g.getIdLong()), USERID.check(userid))) > 0 ? o.put("success", "Entbannung erfolgreich!") : o.put("error", "Die Person war gar nicht gebannt!");
}
Also used : JSONObject(org.jsolf.JSONObject)

Aggregations

JSONObject (org.jsolf.JSONObject)72 TextChannel (net.dv8tion.jda.api.entities.TextChannel)23 Member (net.dv8tion.jda.api.entities.Member)20 Command (de.tectoast.emolga.commands.Command)19 JSONArray (org.jsolf.JSONArray)19 RequestBuilder (de.tectoast.emolga.utils.RequestBuilder)16 CommandCategory (de.tectoast.emolga.commands.CommandCategory)15 GuildCommandEvent (de.tectoast.emolga.commands.GuildCommandEvent)15 Draft (de.tectoast.emolga.utils.draft.Draft)14 Guild (net.dv8tion.jda.api.entities.Guild)13 DraftPokemon (de.tectoast.emolga.utils.draft.DraftPokemon)12 Collectors (java.util.stream.Collectors)11 Logger (org.slf4j.Logger)11 LoggerFactory (org.slf4j.LoggerFactory)11 Tierlist (de.tectoast.emolga.utils.draft.Tierlist)10 Coord (de.tectoast.emolga.utils.records.Coord)9 Draft.getIndex (de.tectoast.emolga.utils.draft.Draft.getIndex)8 ResultSet (java.sql.ResultSet)8 java.util (java.util)8 ArrayList (java.util.ArrayList)7