Refactored code and optimized imports
This commit is contained in:
1 parent
b2c63d73f1
commit
9cef6fb085
5 files changed
+22
-18
No files matched your search
@@ -1,9 +1,5 @@
|
||||
package netneutrality;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import net.dv8tion.jda.core.AccountType;
|
||||
import net.dv8tion.jda.core.JDA;
|
||||
import net.dv8tion.jda.core.JDABuilder;
|
||||
@@ -20,6 +16,9 @@ import netneutrality.utils.Settings;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MusicBot {
|
||||
|
||||
private static JDA jda;
|
||||
@@ -56,6 +55,7 @@ public class MusicBot {
|
||||
System.out.println("Shutting down...");
|
||||
MusicManager.disconnectPlayers();
|
||||
jda.shutdown();
|
||||
ThreadManager.shutdownExecutor();
|
||||
System.out.println("Shutdown complete");
|
||||
System.exit(0);
|
||||
break;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class MysqlDatabase {
|
||||
private int nbRow;
|
||||
private String dbName;
|
||||
|
||||
public MysqlDatabase(String dbName) {
|
||||
MysqlDatabase(String dbName) {
|
||||
this.dbName = dbName;
|
||||
try {
|
||||
MusicBot.LOGGER.info("Connecting to database...");
|
||||
@@ -41,11 +41,17 @@ public class MysqlDatabase {
|
||||
*
|
||||
* @param query The SQL query to execute
|
||||
* @return {@link ResultSet}
|
||||
* @throws SQLException
|
||||
*/
|
||||
public ResultSet query(String query) throws SQLException {
|
||||
Statement stmt = connection.createStatement();
|
||||
return stmt.executeQuery(query);
|
||||
public ResultSet query(String query) {
|
||||
Statement stmt;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
return stmt.executeQuery(query);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package netneutrality.handler;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.entities.MessageChannel;
|
||||
import net.dv8tion.jda.core.entities.PrivateChannel;
|
||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
public class MessageRateLimit {
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package netneutrality.http;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import okhttp3.*;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class WebModule {
|
||||
|
||||
private String url;
|
||||
|
||||
@@ -21,7 +21,6 @@ import netneutrality.MusicBot;
|
||||
import netneutrality.handler.LogHandler;
|
||||
import netneutrality.utils.MessageFunction;
|
||||
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
Reference in new issue
Block a user