top-gg / issues

Report bugs related to Top.gg. For feature requests: https://feedback.top.gg
35 stars 13 forks source link

Your api is broken #402

Closed superSebi closed 4 years ago

superSebi commented 4 years ago

Expected Behavior

That your api is working.

Observed Behavior

Instead your API is returning this:

org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1] at org.json.JSONTokener.syntaxError(JSONTokener.java:507) at org.json.JSONObject.(JSONObject.java:222) at org.json.JSONObject.(JSONObject.java:406) at org.discordbots.api.client.impl.DiscordBotListAPII

Applicable Links or Attachments

Code: public void onReady(@NotNull ReadyEvent event) {

    DiscordBotListAPI api = new DiscordBotListAPI.Builder()
            .token("Here stands the token 👍 ")
            .botId("493066387183632387")
            .build();
    new Timer().schedule(new TimerTask() {

        @Override
        public void run() {
            //event.getJDA().getPresence().setGame(null);
            new Thread(() -> {
                    for (Member m : Objects.requireNonNull(Main.shardMan.getGuildById("504609411243704365")).getMembers()) {
                        api.hasVoted(m.getId()).whenComplete((hasVoted, e) -> {
                            if (hasVoted) {
                                if (!m.getRoles().contains(Objects.requireNonNull(Main.shardMan.getGuildById("504609411243704365")).getRoleById("610402330315325472"))) {
                                    String votes = "Herbert cant load any data";

                                    Objects.requireNonNull(Objects.requireNonNull(Main.shardMan.getGuildById("504609411243704365")).getTextChannelById("504609411243704365")).sendMessage(new EmbedBuilder()
                                            .setColor(Color.cyan)
                                            .setDescription(m.getAsMention() + " voted the **" + votes + "th** for me :heart:")

             .build()).queue();
                                }
                            }
                        });
                    }


#### Steps to Reproduce

1. Exexute the code
2. ...

#### Web Browser and Version

Chrome 

#### Operating System and Version

Windows 10

#### Screen Resolution

1920x1080

#### Additional Information/Comments

.-.
matthew-st commented 4 years ago

nice title

tonkku107 commented 4 years ago

Looks like your issue is about the Java library. You can create an issue for it here: https://github.com/DiscordBotList/DBL-Java-Library