Added some config saving code
This commit is contained in:
parent
19dd0f5ef5
commit
73280fa88e
1 changed files with 8 additions and 1 deletions
|
@ -49,6 +49,10 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
||||||
lastannouncementtime = getConfig().getLong("lastannouncementtime");
|
lastannouncementtime = getConfig().getLong("lastannouncementtime");
|
||||||
lastseentime = getConfig().getLong("lastseentime");
|
lastseentime = getConfig().getLong("lastseentime");
|
||||||
Test = getConfig().getBoolean("test", true);
|
Test = getConfig().getBoolean("test", true);
|
||||||
|
getConfig().set("lastannouncementtime", lastannouncementtime);
|
||||||
|
getConfig().set("lastseentime", lastseentime);
|
||||||
|
getConfig().set("test", Test); // TODO: TMP
|
||||||
|
saveConfig();
|
||||||
}
|
}
|
||||||
ClientBuilder cb = new ClientBuilder();
|
ClientBuilder cb = new ClientBuilder();
|
||||||
cb.withToken(Files.readFirstLine(new File("TBMC", "Token.txt"), StandardCharsets.UTF_8));
|
cb.withToken(Files.readFirstLine(new File("TBMC", "Token.txt"), StandardCharsets.UTF_8));
|
||||||
|
@ -116,6 +120,9 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
stop = true;
|
stop = true;
|
||||||
|
getConfig().set("lastannouncementtime", lastannouncementtime);
|
||||||
|
getConfig().set("lastseentime", lastseentime);
|
||||||
|
saveConfig();
|
||||||
try {
|
try {
|
||||||
dc.changeStatus(Status.game("on TBMC"));
|
dc.changeStatus(Status.game("on TBMC"));
|
||||||
dc.logout();
|
dc.logout();
|
||||||
|
|
Loading…
Reference in a new issue