(String cmd)
| 98 | } |
| 99 | |
| 100 | private static void processCommand(String cmd) { |
| 101 | if (cmd.equalsIgnoreCase("help")) { |
| 102 | System.out.println("Commands:\nstop - Shuts down the bot and exits the program\ndebug - Toggle debug mode"); |
| 103 | return; |
| 104 | } |
| 105 | if (cmd.equalsIgnoreCase("debug")) { |
| 106 | debug = !debug; |
| 107 | String response = debug ? "on" : "off"; |
| 108 | System.out.println("[INFO] Turned " + response + " debug mode"); |
| 109 | Bot.debug("Make sure to turn off debug mode after necessary information has been collected."); |
| 110 | return; |
| 111 | } |
| 112 | if (cmd.equalsIgnoreCase("stop")) { |
| 113 | System.out.println("Shutting down..."); |
| 114 | shardManager.shutdown(); |
| 115 | if (database != null) { |
| 116 | System.out.println("Disconnecting database..."); |
| 117 | database.disconnect(); |
| 118 | } |
| 119 | System.out.println("Bye!"); |
| 120 | System.exit(0); |
| 121 | return; |
| 122 | } |
| 123 | System.out.println("Unknown command. Please use \"help\" for a list of commands."); |
| 124 | } |
| 125 | |
| 126 | /* |
| 127 | Debug Info for Developer information |
no test coverage detected