Added logout and a small fix
This commit is contained in:
parent
bd51083568
commit
4db7bb7082
1 changed files with 7 additions and 2 deletions
|
@ -38,7 +38,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
if (file.exists()) {
|
||||
BufferedReader reader = Files.newReader(file, StandardCharsets.UTF_8);
|
||||
String line = reader.readLine();
|
||||
lastannouncementtime = Integer.parseInt(line);
|
||||
lastannouncementtime = Long.parseLong(line);
|
||||
}
|
||||
ClientBuilder cb = new ClientBuilder();
|
||||
cb.withToken(IOUtils.toString(getClass().getResourceAsStream("/Token.txt"), Charsets.UTF_8));
|
||||
|
@ -72,6 +72,11 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
@Override
|
||||
public void onDisable() {
|
||||
stop = true;
|
||||
try {
|
||||
dc.logout();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private long lastannouncementtime = 0;
|
||||
|
|
Loading…
Reference in a new issue