Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster a97424041c hack: force load QuizBackend 2022-02-21 12:48:26 +01:00
BodgeMaster 9f4421f448 move comments containing db structure to a more appropriate place 2022-02-21 12:46:16 +01:00
2 changed files with 8 additions and 5 deletions

View File

@ -16,14 +16,12 @@ public class Main {
// [0] token, [1] db username, [2] db password
commandLineArguments = args;
// CREATE TABLE questions(id INT(32) AUTO_INCREMENT PRIMARY KEY, question TEXT, max_score INT(8));
// CREATE TABLE answer_coices(id INT(32), answer VARCHAR(2048), correctness BOOLEAN);
// CREATE TABLE user_answers(id INT(32), given_answer VARCHAR(2048), discord_user VARCHAR(1024));
// CREATE TABLE categories(id INT(32), category VARCHAR(1024));
// checks every 7500 ms if a deployment happened, if so shuts down the bot
CheckDeploy check = new CheckDeploy(7500, "/var/www/deployment/Hacky-Quizbot/id.txt");
check.start();
//TODO: remove, this is just a way to force loading of the QuizBackend class while it isnt being loaded automatically
QuizBackend backend = new QuizBackend();
DiscordApi api = new DiscordApiBuilder().setToken(commandLineArguments[0]).login().join();

View File

@ -11,6 +11,11 @@ public class QuizBackend {
private static final String dbPassword = Main.getCommandLineArgument(2);
private static final String dbName = "jdbc:mysql://localhost:3306/quizbot"; //we can make this configurable later
// CREATE TABLE questions(id INT(32) AUTO_INCREMENT PRIMARY KEY, question TEXT, max_score INT(8));
// CREATE TABLE answer_coices(id INT(32), answer VARCHAR(2048), correctness BOOLEAN);
// CREATE TABLE user_answers(id INT(32), given_answer VARCHAR(2048), discord_user VARCHAR(1024));
// CREATE TABLE categories(id INT(32), category VARCHAR(1024));
private static Question[] allQuestions;
private static String[] categories;