Fix build errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-10-24 20:58:44 +02:00
parent a78ef16095
commit efd506eb74
3 changed files with 7 additions and 3 deletions

View File

@ -20,7 +20,7 @@ public class NounsAddSubCommand
String pronoun = args[1].toLowerCase(); String pronoun = args[1].toLowerCase();
if(Cache.dbManager.getPronounId(pronoun) >= 0) if(Cache.dbManager.isPronounValid(pronoun))
{ {
sender.sendMessage("Pronoun already exists!"); sender.sendMessage("Pronoun already exists!");
return true; return true;

View File

@ -19,13 +19,13 @@ public class NounsSetSubCommand
String mainPronoun = args[1].toLowerCase(); String mainPronoun = args[1].toLowerCase();
String secondaryPronoun = args[2].toLowerCase(); String secondaryPronoun = args[2].toLowerCase();
if(!Cache.isPronounValid(mainPronoun)) if(!Cache.dbManager.isPronounValid(mainPronoun))
{ {
sender.sendMessage("Invalid main pronoun!"); sender.sendMessage("Invalid main pronoun!");
return true; return true;
} }
if(!Cache.isPronounValid(secondaryPronoun)) if(!Cache.dbManager.isPronounValid(secondaryPronoun))
{ {
sender.sendMessage("Invalid secondary pronoun!"); sender.sendMessage("Invalid secondary pronoun!");
return true; return true;

View File

@ -129,6 +129,10 @@ public class DatabaseManager
return -1; return -1;
} }
public boolean isPronounValid(String pronoun) {
return getPronounId(pronoun) >= 0;
}
public boolean addNewPronoun(String pronoun, String format) { public boolean addNewPronoun(String pronoun, String format) {
String query = "INSERT INTO pronouns " + String query = "INSERT INTO pronouns " +
"( pronoun, format, id) VALUES " + "( pronoun, format, id) VALUES " +