moving vlog #2
This commit is contained in:
parent
cab29c3340
commit
ec6c8c7527
4 changed files with 8 additions and 11 deletions
|
|
@ -136,23 +136,18 @@ public class Rethink {
|
|||
.with("blacklisted", "none"));
|
||||
}
|
||||
|
||||
// TODO
|
||||
public boolean hasStarboardChannel(String guild_id) {
|
||||
return !this.getByID("server", guild_id, "starboard").equals("");
|
||||
}
|
||||
// TODO
|
||||
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
||||
this.insert("stars", r.hashMap("id", message_id).with("guild", guild_id).with("starboardmsg", starboard_message_id));
|
||||
}
|
||||
// TODO
|
||||
|
||||
public String getStarboardMessage(String message_id) {
|
||||
return (String) this.getByID("stars", message_id, "starboardmsg");
|
||||
}
|
||||
// TODO
|
||||
|
||||
public void removeStarboardMessage(String message_id) {
|
||||
this.remove("stars", "id", message_id);
|
||||
}
|
||||
// TODO
|
||||
|
||||
public boolean hasStarboardMessage(String message_id) {
|
||||
try {
|
||||
this.getByID("stars", message_id, "guild");
|
||||
|
|
@ -162,7 +157,6 @@ public class Rethink {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void pushServer(RethinkServer server) {
|
||||
JSONObject object = new JSONObject();
|
||||
for (Field field : server.getClass().getDeclaredFields()) {
|
||||
|
|
|
|||
|
|
@ -116,6 +116,10 @@ public class RethinkServer {
|
|||
this.starboard = starboard;
|
||||
}
|
||||
|
||||
public boolean hasStarboardChannel() {
|
||||
return !starboard.equals("");
|
||||
}
|
||||
|
||||
public void updateRules(String message_id, String role_id, String accept_emote, String decline_emote) {
|
||||
this.setMessageID(message_id);
|
||||
this.setRoleID(role_id);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public class EvalCommand implements Command {
|
|||
} catch (ScriptException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
engine.put("msg".toLowerCase(), e.getMessage());
|
||||
engine.put("shardmanager".toLowerCase(), Hadder.shardManager);
|
||||
engine.put("rethink".toLowerCase(), e.getRethink());
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class StarboardListener extends ListenerAdapter {
|
|||
if (e.getReaction().getReactionEmote().getName().equals("⭐")) {
|
||||
RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink);
|
||||
if (!rethink.hasStarboardMessage(e.getMessageId())) {
|
||||
if (rethink.hasStarboardChannel(e.getGuild().getId())) {
|
||||
if (rethinkServer.hasStarboardChannel()) {
|
||||
e.getTextChannel().retrieveMessageById(e.getMessageId()).queue(
|
||||
msg -> {
|
||||
int stars = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue