File tree Expand file tree Collapse file tree
src/main/java/org/comroid Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,23 +13,27 @@ public class FileFlag {
1313
1414 @ SneakyThrows
1515 public static boolean enable (File file ) {
16+ if (!file .isAbsolute ()) file = file .getAbsoluteFile ();
1617 return cache .containsKey (file ) && cache .get (file ).enable ();
1718 }
1819
1920 public static boolean consume (File file ) {
21+ if (!file .isAbsolute ()) file = file .getAbsoluteFile ();
2022 return cache .containsKey (file ) && cache .get (file ).consume ();
2123 }
2224
2325 File file ;
2426
27+ public FileFlag (File file ) {
28+ this .file = file .getAbsoluteFile ();
29+ }
30+
2531 @ SneakyThrows
2632 public boolean enable () {
27- if (!file .isAbsolute ()) return enable (file .getAbsoluteFile ());
2833 return file .exists () || file .createNewFile ();
2934 }
3035
3136 public boolean consume () {
32- if (!file .isAbsolute ()) return consume (file .getAbsoluteFile ());
3337 return file .exists () && file .delete ();
3438 }
3539}
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public void initialize() {
8888 log .info ("Upserting %d interactions to discord bot %s" .formatted (all .size (), jda .getSelfUser ()));
8989
9090 RestAction <?> action = PURGE_COMMANDS .consume () ? jda .retrieveCommands ().flatMap (cmds -> {
91- log .fine ("Puring %d previously defined commands" .formatted (cmds .size ()));
91+ log .fine ("Purging %d previously defined commands" .formatted (cmds .size ()));
9292
9393 RestAction <?> sub = new CompletedRestAction <>(jda , (Object ) null );
9494 for (var cmd : cmds )
You can’t perform that action at this time.
0 commit comments