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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>Hadder</groupId>
|
<groupId>Hadder</groupId>
|
||||||
<artifactId>Hadder</artifactId>
|
<artifactId>Hadder</artifactId>
|
||||||
<version>2.0.0</version>
|
<version>2.0.1</version>
|
||||||
<name>Hadder</name>
|
<name>Hadder</name>
|
||||||
<inceptionYear>2019</inceptionYear>
|
<inceptionYear>2019</inceptionYear>
|
||||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,11 @@ public class Mongo {
|
||||||
BasicDBObject whereQuery = new BasicDBObject();
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
whereQuery.put(where, what);
|
whereQuery.put(where, what);
|
||||||
FindIterable<Document> it = collection.find(whereQuery);
|
FindIterable<Document> it = collection.find(whereQuery);
|
||||||
return it.cursor().next().get(column);
|
try {
|
||||||
|
return it.cursor().next().get(column);
|
||||||
|
} catch (NoSuchElementException ignore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject getObjectByID(String collection, String id) {
|
public JSONObject getObjectByID(String collection, String id) {
|
||||||
|
|
@ -133,8 +137,7 @@ public class Mongo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasStarboardMessage(String message_id) {
|
public boolean hasStarboardMessage(String message_id) {
|
||||||
this.getByID("stars", "id", message_id, "guild");
|
return this.getByID("stars", "id", message_id, "guild") != null;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue