Add embeds footer text to custom translations. #3
2 arquivos alterados com 19 adições e 3 exclusões
Fix help command.
Set a minimum allowed value to whitelistScheduledVerificationSeconds.
commit
bfbb1dccf8
|
|
@ -46,7 +46,19 @@ public class Config {
|
|||
|
||||
configData = AutoWhitelist.GSON.fromJson(stringReader, ConfigData.class);
|
||||
|
||||
if (configData.whitelistScheduledVerificationSeconds < 30) {
|
||||
if (configData.whitelistScheduledVerificationSeconds <= 0) {
|
||||
configData.whitelistScheduledVerificationSeconds = 30;
|
||||
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time can't be equals to or lower than 0. It has been set to 30 (not on the file)");
|
||||
try {
|
||||
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time can't be equals to or lower than 0. It has been set to 30 (not on the file)"), true);
|
||||
} catch (NullPointerException ignored) {}
|
||||
} else if (configData.whitelistScheduledVerificationSeconds < 3) {
|
||||
configData.whitelistScheduledVerificationSeconds = 30;
|
||||
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time have to be at least 3 seconds. It has been set to 30 (not on the file)");
|
||||
try {
|
||||
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time have to be at least 3 seconds. It has been set to 30 (not on the file)"), true);
|
||||
} catch (NullPointerException ignored) {}
|
||||
} else if (configData.whitelistScheduledVerificationSeconds < 30) {
|
||||
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time is really low. It is not recommended to have it lower than 30 seconds, since it can affect the server performance.");
|
||||
try {
|
||||
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time is really low. It is not recommended to have it lower than 30 seconds, since it can affect the server performance."), true);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.jagrosh.jdautilities.command.Command;
|
|||
import com.jagrosh.jdautilities.command.CommandClient;
|
||||
import com.jagrosh.jdautilities.command.CommandClientBuilder;
|
||||
import com.jagrosh.jdautilities.command.CommandEvent;
|
||||
import com.jagrosh.jdautilities.examples.command.PingCommand;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
import net.dv8tion.jda.api.events.ReadyEvent;
|
||||
|
|
@ -49,6 +50,7 @@ public class BotEventListener extends ListenerAdapter {
|
|||
builder.setHelpConsumer(generateHelpConsumer());
|
||||
builder.addCommands(
|
||||
new RegisterCommand(),
|
||||
new PingCommand(),
|
||||
|
||||
//Developer commands
|
||||
new ServerStatusCommand(),
|
||||
|
|
@ -76,7 +78,7 @@ public class BotEventListener extends ListenerAdapter {
|
|||
Command.Category category;
|
||||
List<MessageEmbed.Field> fields = new ArrayList<>();
|
||||
for (Command command : event.getClient().getCommands()) {
|
||||
if (!command.isHidden() && (!command.isOwnerCommand() || event.isOwner())) {
|
||||
if ((!command.isHidden() && !command.isOwnerCommand()) || event.isOwner()) {
|
||||
|
||||
String command_ = "\n`" +
|
||||
event.getClient().getPrefix() +
|
||||
|
|
@ -104,9 +106,11 @@ public class BotEventListener extends ListenerAdapter {
|
|||
commands = "";
|
||||
commands += "\n" + field.getValue();
|
||||
lastName = field.getName();
|
||||
} else {
|
||||
} else if (fields.size() > 1) {
|
||||
commands += field.getValue();
|
||||
lastName = field.getName();
|
||||
} else {
|
||||
mergedFields.add(new MessageEmbed.Field(field.getName(), field.getValue(), false));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Referência em uma nova issue