parent
ea0ef88068
commit
acd45ce4ae
1 changed files with 6 additions and 2 deletions
|
@ -141,6 +141,10 @@ public class DiscordPlugin extends ButtonPlugin {
|
||||||
|
|
||||||
private void handleReady(List<GuildCreateEvent> event) {
|
private void handleReady(List<GuildCreateEvent> event) {
|
||||||
try {
|
try {
|
||||||
|
if(!SafeMode) {
|
||||||
|
getLogger().info("Ready again, already enabled."); //TODO: It should probably handle disconnections
|
||||||
|
return;
|
||||||
|
}
|
||||||
mainServer = mainServer().get().orElse(null); //Shouldn't change afterwards
|
mainServer = mainServer().get().orElse(null); //Shouldn't change afterwards
|
||||||
getCommand2MC().registerCommand(new DiscordMCCommand()); //Register so that the reset command works
|
getCommand2MC().registerCommand(new DiscordMCCommand()); //Register so that the reset command works
|
||||||
if (mainServer == null) {
|
if (mainServer == null) {
|
||||||
|
@ -264,8 +268,8 @@ public class DiscordPlugin extends ButtonPlugin {
|
||||||
try {
|
try {
|
||||||
SafeMode = true; // Stop interacting with Discord
|
SafeMode = true; // Stop interacting with Discord
|
||||||
ChromaBot.delete();
|
ChromaBot.delete();
|
||||||
timings.printElapsed("Updating presence...");
|
//timings.printElapsed("Updating presence...");
|
||||||
dc.updatePresence(Presence.idle(Activity.playing("Chromacraft"))).block(); //No longer using the same account for testing
|
//dc.updatePresence(Presence.idle(Activity.playing("logging out"))).block(); //No longer using the same account for testing
|
||||||
timings.printElapsed("Logging out...");
|
timings.printElapsed("Logging out...");
|
||||||
dc.logout().block();
|
dc.logout().block();
|
||||||
//Configs are emptied so channels and servers are fetched again
|
//Configs are emptied so channels and servers are fetched again
|
||||||
|
|
Loading…
Reference in a new issue