This commit is contained in:
parent
a78ef16095
commit
efd506eb74
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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 " +
|
||||||
|
Loading…
Reference in New Issue
Block a user