Revert "null"

This reverts commit 07b8749e0b.
This commit is contained in:
GregTCLTK 2020-02-02 16:05:25 +01:00
parent 80a4137dca
commit 07edce3df3
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67
4 changed files with 19 additions and 25 deletions

View file

@ -18,7 +18,6 @@ package com.bbn.hadder;
import com.bbn.hadder.core.Config; import com.bbn.hadder.core.Config;
import com.rethinkdb.RethinkDB; import com.rethinkdb.RethinkDB;
import com.rethinkdb.gen.exc.ReqlNonExistenceError;
import com.rethinkdb.gen.exc.ReqlOpFailedError; import com.rethinkdb.gen.exc.ReqlOpFailedError;
import com.rethinkdb.net.Connection; import com.rethinkdb.net.Connection;
import org.json.JSONArray; import org.json.JSONArray;
@ -126,10 +125,10 @@ public class Rethink {
this.insert("server", r this.insert("server", r
.hashMap("id", id) .hashMap("id", id)
.with("prefix", "h.") .with("prefix", "h.")
.with("message_id", null) .with("message_id", "")
.with("role_id", null) .with("role_id", "")
.with("invite_detect", false) .with("invite_detect", false)
.with("starboard", null) .with("starboard", "")
.with("neededstars", "4") .with("neededstars", "4")
); );
} }
@ -144,7 +143,7 @@ public class Rethink {
// TODO // TODO
public boolean hasStarboardChannel(String guild_id) { public boolean hasStarboardChannel(String guild_id) {
return this.getByID("server", guild_id, "starboard") != null; return !this.getByID("server", guild_id, "starboard").equals("");
} }
// TODO // TODO
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) { public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
@ -160,12 +159,7 @@ public class Rethink {
} }
// TODO // TODO
public boolean hasStarboardMessage(String message_id) { public boolean hasStarboardMessage(String message_id) {
try { return this.getByID("stars", message_id, "guild") != null;
this.getByID("stars", message_id, "guild");
return true;
} catch (ReqlNonExistenceError e) {
return false;
}
} }

View file

@ -24,15 +24,15 @@ public class RethinkServer {
private Rethink rethink; private Rethink rethink;
public String accept_emote = null; String accept_emote = "";
public String decline_emote = null; String decline_emote = "";
public String id; String id;
public boolean invite_detect = false; boolean invite_detect = false;
public String message_id = null; String message_id = "";
public String neededstars = "3"; String neededstars = "3";
public String prefix = "h."; String prefix = "h.";
public String role_id = null; String role_id = "";
public String starboard = null; String starboard = "";
public RethinkServer(JSONObject object, Rethink rethink) { public RethinkServer(JSONObject object, Rethink rethink) {
for (Field field : this.getClass().getDeclaredFields()) { for (Field field : this.getClass().getDeclaredFields()) {

View file

@ -24,10 +24,10 @@ public class RethinkUser {
private Rethink rethink; private Rethink rethink;
public String id; String id;
public String prefix = "h."; String prefix = "h.";
public String language = "en"; String language = "en";
public String blacklisted = null; String blacklisted = "none";
public RethinkUser(JSONObject object, Rethink rethink) { public RethinkUser(JSONObject object, Rethink rethink) {
for (Field field : this.getClass().getDeclaredFields()) { for (Field field : this.getClass().getDeclaredFields()) {

View file

@ -69,7 +69,7 @@ public class CommandHandler {
boolean run = true; boolean run = true;
String blacklisted = rethinkUser.getBlacklisted(); String blacklisted = rethinkUser.getBlacklisted();
if (null != blacklisted) { if (!"none".equals(blacklisted)) {
for (String BLLabel : blacklisted.split(",")) { for (String BLLabel : blacklisted.split(",")) {
if (Arrays.asList(cmd.labels()).contains(BLLabel)) { if (Arrays.asList(cmd.labels()).contains(BLLabel)) {
run = false; run = false;