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

View file

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

View file

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

View file

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