You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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();
}
}
});
}
The text was updated successfully, but these errors were encountered:
Expected Behavior
That your api is working.
Observed Behavior
Instead your API is returning this:
Code:
The text was updated successfully, but these errors were encountered: