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();
if(Cache.dbManager.getPronounId(pronoun) >= 0)
if(Cache.dbManager.isPronounValid(pronoun))
{
sender.sendMessage("Pronoun already exists!");
return true;

View File

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

View File

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