Sync with master #685
2 changed files with 7 additions and 4 deletions
2
pom.xml
2
pom.xml
|
|
@ -6,7 +6,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>Hadder</groupId>
|
||||
<artifactId>Hadder</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
<name>Hadder</name>
|
||||
<inceptionYear>2019</inceptionYear>
|
||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,11 @@ public class Mongo {
|
|||
BasicDBObject whereQuery = new BasicDBObject();
|
||||
whereQuery.put(where, what);
|
||||
FindIterable<Document> it = collection.find(whereQuery);
|
||||
try {
|
||||
return it.cursor().next().get(column);
|
||||
} catch (NoSuchElementException ignore) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject getObjectByID(String collection, String id) {
|
||||
|
|
@ -133,8 +137,7 @@ public class Mongo {
|
|||
}
|
||||
|
||||
public boolean hasStarboardMessage(String message_id) {
|
||||
this.getByID("stars", "id", message_id, "guild");
|
||||
return true;
|
||||
return this.getByID("stars", "id", message_id, "guild") != null;
|
||||
}
|
||||
|
||||
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue