Update 'src/main/java/com/the5gi/DeepJ/Translator.java'

This commit is contained in:
5gi 2022-12-07 12:36:11 -05:00
parent c1438bff2a
commit fcb20efbd8

View File

@ -23,26 +23,26 @@ public class Translator {
if (globalAuthKey == null) {
System.out.println("\n[DeepJ] You are currently using the Global API Key Translator Constructor." +"\n[DeepJ] If you are trying to use global API keys, Call the method \"Translator.setGlobalAuthKey(String key)\" and then re-use this contructor." + "\n[DeepJ] If you want to define an different authkey every time do: \"new Translator(String authKey)\"\n");
} else {
request = new Request(globalAuthKey);
request = new Request(globalAPIKey);
}
}
public Translator(String authKey) {
if (!Objects.equals(globalAuthKey, "null")) {
if (!Objects.equals(globalAPIKey, "null")) {
System.out.println("[DeepJ] Looks like you have defined a global API key already! You can use if by just typing \"new Traslator()\"" + "\n instead of \"new Translator(String authKey)\". NOTE: This will work but just some advice :)");
}
request = new Request(authKey);
}
public Translator(String authKey, boolean silence) {
if (!Objects.equals(globalAuthKey, "null") && !silence) {
public Translator(String apiKey, boolean silence) {
if (!Objects.equals(globalAPIKey, "null") && !silence) {
System.out.println("[DeepJ] Looks like you have defined a global API key already! You can use if by just typing \"new Traslator()\"" + "\n instead of \"new Translator(String authKey)\". NOTE: This will work but this is just some advice :)");
}
request = new Request(authKey);
request = new Request(apiKey);
}
public static void setGlobalAPIKey(String key) {
globalAuthKey = key;
globalAPIKey = key;
}
public static Translator newTranslator(String authKey) {
return new Translator(authKey);
public static Translator newTranslator(String apiKey) {
return new Translator(apiKey);
}
public static Translator newTranslator() {
if (globalAuthKey == null) {