Skip to content

Commit 80e8621

Browse files
committed
Minor bug fix and improvements
1 parent 2bdcb0b commit 80e8621

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/main/java/ml/duncte123/skybot/commands/essentials/eval/EvalCommand.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public class EvalCommand extends Command {
5959
return service;
6060
};
6161
private EvalFilter filter = new EvalFilter();
62+
63+
public boolean runIfNotOwner;
6264

6365
/**
6466
* This initialises the engine
@@ -120,6 +122,9 @@ public void executeCommand(String invoke, String[] args, GuildMessageReceivedEve
120122
event.getAuthor().getId()) ||
121123
event.getAuthor().getId().equals(Settings.ownerId);
122124

125+
if (isRanByBotOwner == !isRanByBotOwner)
126+
return;
127+
123128
if (!isRanByBotOwner && !hasUpvoted(event.getAuthor())) {
124129
sendError(event.getMessage());
125130
sendEmbed(event,
@@ -256,4 +261,16 @@ public String getName() {
256261
public String[] getAliases() {
257262
return new String[]{"eval™", "evaluate", "evan", "eva;"};
258263
}
264+
265+
public boolean toggleFilter() {
266+
boolean ret = runIfNotOwner;
267+
runIfNotOwner = !runIfNotOwner;
268+
return ret;
269+
}
270+
271+
public boolean setFilter(boolean status) {
272+
boolean ret = runIfNotOwner;
273+
runIfNotOwner = status;
274+
return ret;
275+
}
259276
}

src/main/kotlin/ml/duncte123/skybot/utils/EarthUtils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.json.JSONArray
3535
import org.json.JSONObject
3636
import java.io.File
3737
import java.io.FileOutputStream
38+
import java.time.OffsetDateTime
3839

3940
@SinceSkybot("3.51.5")
4041
@DocumentationNeeded
@@ -97,7 +98,7 @@ class EarthUtils {
9798

9899
@JvmStatic
99100
fun audioJSON(): JSONObject {
100-
val json = JSONObject()
101+
val json = JSONObject().put("time", OffsetDateTime.now())
101102
AirUtils.audioUtils.musicManagers.entries.forEach { json.put(it.key, JSONObject().put("guildId", it.key).put("manager", gMMtoJSON(it.value))) }
102103
return json
103104
}

0 commit comments

Comments
 (0)